Skip to content

Ensure model_fields is called on a BaseModel subclass#43

Open
ocktowen wants to merge 1 commit intotefra:mainfrom
ocktowen:pydantic-deprecated-instance-attribute
Open

Ensure model_fields is called on a BaseModel subclass#43
ocktowen wants to merge 1 commit intotefra:mainfrom
ocktowen:pydantic-deprecated-instance-attribute

Conversation

@ocktowen
Copy link
Copy Markdown

📒 Description

In some cases get_fields receives an instance of a pydantic model. Accessing the model_fields attribute from the instance is deprecated and it should be accessed from the class.

🔗 What I've Done

I added an extra check to ensure the obj is always a class.

🛫 Checklist

  • Updated docs
  • Added unit-tests

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.

1 participant