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

dataclasses.InitVar not supported #592

Closed
pfrederiks opened this issue Jun 13, 2019 · 0 comments
Closed

dataclasses.InitVar not supported #592

pfrederiks opened this issue Jun 13, 2019 · 0 comments

Comments

@pfrederiks
Copy link
Contributor

Bug

When a dataclass contains an InitVar field, pydantic will try to validate it and does not pass the InitVar to post_init.

Using InitVar will raise the following error:

RuntimeError: no validator found for <class 'dataclasses.InitVar'>

And when arbitrary_types_allowed is set the following exception is raised:

TypeError: _pydantic_post_init() takes 1 positional argument but 2 were given

I have a pull request.

For bugs/questions:

  • OS: any
  • Python version: 3.7
  • Pydantic version : 0.28
@pfrederiks pfrederiks mentioned this issue Jun 13, 2019
4 tasks
alexdrydew pushed a commit to alexdrydew/pydantic that referenced this issue Dec 23, 2023
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

2 participants