Replies: 3 comments 2 replies
-
This is also an issue with |
Beta Was this translation helpful? Give feedback.
0 replies
-
@gp1105739 Have you found a work around for this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
do: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
We use sqlmodel and SQLAlchemy to define and save data models. When SQLAlchemy try to create an instance based on the query result, it calls new of ModelMetaclass. However, the new does not create pydantic_private when there is no private_attributes. It errors out when we try to compare objects by calling eq due to self.pydantic_private == other.pydantic_private . We get AttributeError object has no attribute 'pydantic_private'
It seems like some part of is missing in
SQLModelMetaclass.__new__
For example, in pydantic
BaseModel.model_construct
, there is a code block as following but it is missing fromSQLModelMetaclass.__new__
Operating System
Linux
Operating System Details
No response
SQLModel Version
0.0.14
Python Version
3.10
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions