Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Dec 17, 2024
1 parent 03f9f69 commit 95872d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jupyter_events/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ def validate_schema(schema: dict[str, Any]) -> None:
try:
# If the `version` attribute is an integer, coerce to string.
# TODO: remove this in a future version.
if "version" in schema and type(schema["version"]) == int:
if "version" in schema and isinstance(schema["version"], int):
schema["version"] = str(schema["version"])
msg = (
"The `version` property of an event schema must be a string. "
"It has been type coerced, but in a future version of this "
"library, it will fail to validate. Please update schema: "
f"{schema['$id']}"
)
warnings.warn(JupyterEventsVersionWarning(msg))
warnings.warn(JupyterEventsVersionWarning(msg), stacklevel=2)
# Validate the schema against Jupyter Events metaschema.
JUPYTER_EVENTS_SCHEMA_VALIDATOR.validate(schema)
except ValidationError as err:
Expand Down

0 comments on commit 95872d4

Please sign in to comment.