Skip to content

BaseSettings - pylance complains for not setting default values to fields #3753

@calvo-jp

Description

@calvo-jp

Hi! I am a huge fan. I am just encountering an error at the moment. The code below used to have no issue with pylance using previous pydantic version. But, right now I can no longer create an instance without having to pass values to fields that are supposed to be set only in .env or loaded from environment. It is really nice that it now offers autocomplete (same goes to BaseModel) and it actually still works. It's just that I really do not like the view of squiggly lines 😄 Would there be a quick fix for this?

Screenshot from 2022-01-30 10-12-43

These are my vscode settings, btw.

"python.analysis.typeCheckingMode": "basic",
"python.languageServer": "Pylance",

Thank you in advance for your response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug V1Bug related to Pydantic V1.X

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions