Skip to content

Commit 77b90e4

Browse files
MAINT: Bump the minor-and-patch group with 12 updates (#2253)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: jsong468 <songjustin@microsoft.com>
1 parent 88db920 commit 77b90e4

4 files changed

Lines changed: 249 additions & 248 deletions

File tree

‎pyrit/datasets/seed_datasets/remote/mossbench_dataset.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,14 @@ def _parse_oversensitivity_type(example: dict[str, Any]) -> MossBenchOversensiti
404404
"""
405405
meta = example.get("metadata") or {}
406406
raw_over = meta.get("over")
407-
if raw_over not in _RAW_OVERSENSITIVITY_TO_ENUM:
407+
enum_value = _RAW_OVERSENSITIVITY_TO_ENUM.get(raw_over) if isinstance(raw_over, str) else None
408+
if enum_value is None:
408409
valid = ", ".join(sorted(_RAW_OVERSENSITIVITY_TO_ENUM))
409410
raise ValueError(
410411
f"MOSSBench example pid={example.get('pid', '?')} has unknown over type "
411412
f"{raw_over!r}; expected one of: {valid}."
412413
)
413-
return _RAW_OVERSENSITIVITY_TO_ENUM[raw_over]
414+
return enum_value
414415

415416
@staticmethod
416417
def _extract_metadata(

‎pyrit/models/identifiers/component_identifier.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def _normalize_input(cls, data: Any) -> Any:
527527

528528
params_dict = data.get("params")
529529
if isinstance(params_dict, dict):
530-
collisions = set(params_dict) & RESERVED_PARAM_NAMES
530+
collisions: set[str] = {str(name) for name in params_dict} & RESERVED_PARAM_NAMES
531531
if collisions:
532532
raise ValueError(f"ComponentIdentifier params must not use reserved names: {sorted(collisions)}")
533533

‎pyrit/models/seeds/seed_dataset.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def group_seed_prompts_by_prompt_group_id(seeds: Sequence[Seed]) -> Sequence[See
357357
seed_groups: list[SeedGroup] = []
358358
for group_seeds in grouped_seeds.values():
359359
if len(group_seeds) > 1:
360-
group_seeds.sort(key=lambda s: s.sequence if hasattr(s, "sequence") else 0)
360+
group_seeds.sort(key=lambda s: getattr(s, "sequence", 0))
361361

362362
# Try to create a AttackSeedGroup first; fall back to SeedGroup if validation fails
363363
try:

0 commit comments

Comments
 (0)