Skip to content

Commit

Permalink
Catch TypeNotSupportedError with py-avro-schema 2.2 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
faph authored Jul 28, 2023
2 parents 31dc841 + 0d4e969 commit 7990795
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies = [
"importlib-metadata<4; python_version<'3.8'",
"memoization~=0.4",
"orjson~=3.0",
"py-avro-schema~=2.1",
"py-avro-schema~=2.2",
"python-dateutil~=2.8",
]

Expand Down
2 changes: 1 addition & 1 deletion src/py_adapter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def for_py_type(cls, py_type: Type) -> "_ObjectAdapter":
schema = avro.schema.parse(
pas.generate(py_type, options=pas.Option.LOGICAL_JSON_STRING | pas.Option.MILLISECONDS).decode("utf-8")
)
except TypeError:
except pas.TypeNotSupportedError:
raise TypeError(f"{py_type} not supported by py-adapter since it is not supported by py-avro-schema")
return cls(schema)

Expand Down

0 comments on commit 7990795

Please sign in to comment.