-
-
Notifications
You must be signed in to change notification settings - Fork 595
Closed
Labels
BugSomething doesn't work the way it should.Something doesn't work the way it should.
Description
Background
jsonschema.exceptions._WrappedReferencingError
is unhashable. This is causing issues with error tracking services (e.g. Rollbar) when trying to report these errors to the service.
Steps to Reproduce
import jsonschema
from typing import Hashable
try:
jsonschema.validate(
instance={
"definitions": {"apiVersion": "v1"},
},
schema={
"properties": {
"definitions": {
"$ref": "https://app.pixiebrix.com/schemas/innerDefinition#",
},
},
},
)
except jsonschema.exceptions._WrappedReferencingError as e:
print(isinstance(e, Hashable)) # prints False
print(hash(e)) # raisesTypeError: unhashable type: '_WrappedReferencingError'
Expected Behavior
I believe exceptions should be hashable. See the following simple example:
from typing import Hashable
try:
assert False
except Exception as e:
print(isinstance(e, Hashable)) # prints True
print(hash(e)) # prints 270994222
Metadata
Metadata
Assignees
Labels
BugSomething doesn't work the way it should.Something doesn't work the way it should.