-
Notifications
You must be signed in to change notification settings - Fork 12
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
chore(lint): get around a Pydantic 2.10.x type bug #566
Conversation
Both mypy and pyright complain that the "field.default_factory()" call has too few arguments, even though its type is typing.Callable[[], Any]. It should be fixed soon, and in the meantime we can ignore the spurious error. Ref: pydantic/pydantic#10945
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we include some sort of "# TODO:" comment or something to remind us to come back and remove this ignore directive? I can see this accidentally staying for a long time after the bug is fixed otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Note that pydantic/pydantic#10945 won't get fixed as you could expect. Instead, I would suggest following the approach I suggested in this comment. In 2.10.3 (to be released soon), I'll add an extra attribute on the |
@Viicos thanks for the heads-up! |
Both mypy and pyright complain that the "field.default_factory()" call has too few arguments, even though its type is typing.Callable[[], Any]. It should be fixed soon, and in the meantime we can ignore the spurious error. Ref: pydantic/pydantic#10945
Both mypy and pyright complain that the "field.default_factory()" call has too few arguments, even though its type is typing.Callable[[], Any]. It should be fixed soon, and in the meantime we can ignore the spurious error.
Ref: pydantic/pydantic#10945
tox
?