Skip to content

Commit

Permalink
coerce types to compare versions
Browse files Browse the repository at this point in the history
  • Loading branch information
afshin committed Oct 30, 2024
1 parent 26d9115 commit fff55ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jupyter_server/services/events/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ def validate_model(
message = f"Missing `{key}` in the JSON request body."
raise Exception(message)
schema_id = cast(str, data.get("schema_id"))
version = cast(int, data.get("version"))
schema = registry.get(schema_id)
if schema.version != version:
message = f"Unregistered version: `{version}` for `{schema_id}`"
version = int(data.get("version"))
if cast(int, schema.version) != version:
message = f"Unregistered version: {version}{schema.version} for `{schema_id}`"
raise Exception(message)


Expand Down

0 comments on commit fff55ce

Please sign in to comment.