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

Field validation doesn't handle PydanticUndefined #750

Open
drawnwren opened this issue Sep 17, 2024 · 0 comments
Open

Field validation doesn't handle PydanticUndefined #750

drawnwren opened this issue Sep 17, 2024 · 0 comments

Comments

@drawnwren
Copy link

When trying to serialize a simple dataclass i.e.:

class A(AvroBaseModel):
    a: uuid.UUID = Field(uuid.UUID, description="a simple field")

Pydantic will set the default parameter to PydanticUndefined, but dataclasses-avroschema asserts,

  File "site-packages/dataclasses_avroschema/fields/fields.py", line 728, in validate_default
    assert isinstance(default, (str, uuid.UUID)), msg

I think this happens in all of the type render methods. Everything seems to work correctly when I leave Field off.

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

No branches or pull requests

1 participant