Skip to content

Commit

Permalink
fix(typing): Ignore [arg-type] error in _deduplicate_enum_errors (#…
Browse files Browse the repository at this point in the history
…3475)

* fix(typing): Confirm arg type before joining in `_deduplicate_enum_errors`

Fixes `mypy` error that appeared during a merge #3467 (comment)

* revert: undo last commit

* revert: Ignore type error introduced by `typeshed`

The issue is not related to any runtime changes python-jsonschema/jsonschema#1019 (comment)
  • Loading branch information
dangotbanned authored Jul 13, 2024
1 parent 53ee187 commit 86d6b89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion altair/utils/schemapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def _deduplicate_enum_errors(errors: ValidationErrorList) -> ValidationErrorList
# Values (and therefore `validator_value`) of an enum are always arrays,
# see https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values
# which is why we can use join below
value_strings = [",".join(err.validator_value) for err in errors]
value_strings = [",".join(err.validator_value) for err in errors] # type: ignore
longest_enums: ValidationErrorList = []
for value_str, err in zip(value_strings, errors):
if not _contained_at_start_of_one_of_other_values(value_str, value_strings):
Expand Down
2 changes: 1 addition & 1 deletion tools/schemapi/schemapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def _deduplicate_enum_errors(errors: ValidationErrorList) -> ValidationErrorList
# Values (and therefore `validator_value`) of an enum are always arrays,
# see https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values
# which is why we can use join below
value_strings = [",".join(err.validator_value) for err in errors]
value_strings = [",".join(err.validator_value) for err in errors] # type: ignore
longest_enums: ValidationErrorList = []
for value_str, err in zip(value_strings, errors):
if not _contained_at_start_of_one_of_other_values(value_str, value_strings):
Expand Down

0 comments on commit 86d6b89

Please sign in to comment.