sqlmodel StrEnum
vs. Enum
processing
#12123
Replies: 2 comments 1 reply
-
Hi, It's really hard to follow what you are doing. What is Field, what is AutoString? |
Beta Was this translation helpful? Give feedback.
-
Hi @CaselIT, i've included the relevant imports below:
both
My hypothesis was formed primarily by following the stacktrace and digging into some of the details of how enums are handled by sqlalchemy. Hopefully you can shine a bit more light on this for us 😄 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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:
Beta Was this translation helpful? Give feedback.
All reactions