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

Config: inherit all pydantic models from a common base class #11857

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Dec 13, 2024

No description provided.

@stsewd stsewd requested a review from a team as a code owner December 13, 2024 20:21
@stsewd stsewd requested a review from humitos December 13, 2024 20:21
from pydantic import BaseModel, ConfigDict


class Parent(BaseModel):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't name it Parent but something with a more explicit meaning. Maybe something like BaseConfigKey.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be BaseModel too, and import pydantic's BaseModel with a different name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to re-use a name that already exists if we can use a new one more explicit 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, BaseModel it's what we want, so what about ParentModel?

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

Successfully merging this pull request may close these issues.

2 participants