Potential Bug in handling of StrEnum
vs. Enum
#1224
Unanswered
danmurphy1217
asked this question in
Questions
Replies: 1 comment
-
hey @tiangolo are you able to look into this please? Or if there is someone else supporting the project who can 🙏 |
Beta Was this translation helpful? Give feedback.
0 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
I opened up a discussion with sqlalchemy, context is here. They seem to believe this is an issue with SqlModel and not SqlAlchemy. Pasting my initial comment below:
We have the following Str Enums:
we typed the columns in our respective tables as such:
base.EnumStrField
is defined as this:when querying for data from our tables, we get the following error:
The full stacktrace is:
Changing the typing of the enums to
Enum
solved the problem. It seems like there is an issue on howStrEnums
vs. TraditionalEnums
are processed/handled.Is this a known issue? Is there something specific to our implementation that might be incorrect?
I followed thru the stacktrace and it seems like the issue could be with how the "valid_lookup" is performed in sqlalchemy:
Operating System
Linux, macOS
Operating System Details
No response
SQLModel Version
0.0.16
Python Version
3.12.7
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions