To validate that the parameter types are instances of sqlalchemy.sql.sqltypes #1271
Unanswered
tiankongzhise
asked this question in
Questions
Replies: 0 comments
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
When running, the error raise ValueError(f"{type_} has no matching SQLAlchemy type") occurs, which is quite absurd.
I suggest adding a check for sqlalchemy.sql.sqltypes itself in the SQLModelMetaclass.get_sqlalchemy_type method.
For example, modifying the line
if issubclass(type_, datetime):
to
if issubclass(type_, datetime) | issubclass(type_, DateTime)
would resolve this issue.
Operating System
Windows
Operating System Details
No response
SQLModel Version
0.0.22
Python Version
3.12.1
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions