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

Using ConfigDict or SettingsConfigDict requires an annotation #14

Open
antazoey opened this issue Aug 1, 2024 · 0 comments
Open

Using ConfigDict or SettingsConfigDict requires an annotation #14

antazoey opened this issue Aug 1, 2024 · 0 comments

Comments

@antazoey
Copy link

antazoey commented Aug 1, 2024

When I use other config classes, such as ConfigDict, I get flake8 errors with this plugin.
Attempting to annotate those classes leads to mypy complaining about overrides from base model to submodels, and the pydantic documentation doesn't show extra annotation here.

For example, if I have

    model_config = ConfigDict(arbitrary_types_allowed=True)

flake8 errors with

    PYD002 Non-annotated attribute inside Pydantic model

Changing it to

    model_config: ConfigDict = ConfigDict(arbitrary_types_allowed=True)

is not ideal for a few reasons stated above!

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