Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jsonschema exception str|int containers #7981

Merged
merged 1 commit into from
May 29, 2022

Conversation

sirosen
Copy link
Contributor

@sirosen sirosen commented May 29, 2022

Related to #7980, I checked for more attributes where I had made the mistake of introducing a <container>[str] annotation which should read <container>[str | int]

I didn't have an example usage in mind, so I tried adding a for x in schema_path: assert isinstance(x, str) to the error init and running jsonschema's tests. It failed (as expected) on ints, so I'm certain that the original annotation I added has an error in it and I'm reasonably confident that str | int is the correct form.

schema_path, relative_schema_path, and absolute_schema_path are all (related) attributes of jsonschema errors which contain str | int but were accidentally annotated as containing str. Fix them for accuracy.

schema_path, relative_schema_path, and absolute_schema_path are all
(related) attributes of `jsonschema` errors which contain `str | int`
but were accidentally annotated as containing `str`. Fix them for
accuracy.
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood merged commit b2aaed1 into python:master May 29, 2022
@sirosen sirosen deleted the jsonschema-exceptions-bugfix branch May 30, 2022 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants