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

Ensure pyright types are still intact after using the mixin #6

Open
ddanier opened this issue Oct 31, 2023 · 0 comments
Open

Ensure pyright types are still intact after using the mixin #6

ddanier opened this issue Oct 31, 2023 · 0 comments

Comments

@ddanier
Copy link
Member

ddanier commented Oct 31, 2023

See pydantic/pydantic#857 (comment) and pydantic/pydantic#857 (comment)

@ddanier thank you for that! It works really well. The only issue is it removes the pyright types:

Without AsyncValidationModelMixin:

image

With AsyncValidationModelMixin:

image

AND

@ddanier I found a fix for the typing issue; in metaclasses.py line 17; you can change it to (make sure to add the missing imports):

@dataclass_transform(kw_only_default=True, field_specifiers=(Field,))
class AsyncValidationModelMetaclass(ModelMetaclass):
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