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

Bug: SkipValidation annotation: TypeError: asdict() should be called on dataclass instances #658

Closed
1 of 4 tasks
choucavalier opened this issue Mar 12, 2025 · 0 comments · Fixed by #660
Closed
1 of 4 tasks
Labels
bug Something isn't working

Comments

@choucavalier
Copy link

choucavalier commented Mar 12, 2025

Description

from typing import Annotated
import pydantic
import polyfactory.factories.pydantic_factory


class Foo(pydantic.BaseModel):
  bar: Annotated[str, pydantic.SkipValidation, pydantic.Field()]


class Fact(polyfactory.factories.pydantic_factory.ModelFactory[Foo]):
  pass


Fact().build()

Release Version

polyfactory v2.19.0

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant