-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gino does not work correctly with enum types in postgresql #814
Comments
I found a "cache lookup failed" related issue in sqlalchemy sqlalchemy/sqlalchemy#6645 . Maybe the 1 described behavior is not a GINO's bug. But I'm not sure about the 2 behavior. |
One more thing. I found that async sqlalchemy (with asyncpg driver) works as expected for me in 1 and 2 cases (full code in repo). Dependencies:
I see a newer version of sqlalchemy here:
I'm not 100% sure if sqlalchemy upgrade will solve the problem with enums, but I'd like to ask. What's the reason to deny a higher version of sqlalchemy? P.S. I found the question on SO about 1 case (described in the first message). It looks like 1.4 sqlalchemy version upgrade won't totaly fix the problem. https://stackoverflow.com/questions/68000969/sqlalchemy-1-4-throws-internalservererror-cache-lookup-failed-for-type-3912040 UPD: found gino develop plans for future and integration with sqlalchemy here. |
Describe the bug
I'm trying to use gino in postgres with simple model with enum column type. It seems like enum is not fully supported and it behaves really strange in several cases:
where
filters,asyncpg.exceptions.InternalServerError: cache lookup failed for type 16453
error occursdb.gino.create_all()
,asyncpg.exceptions.UndefinedObjectError: type "test-schema.enum1" does not exist
error occursTo Reproduce
The full example is in my repo: https://github.com/zerlok/python-bugs/tree/gino/enum-usage
Expected result
I want all my test runs to finish without described exceptions. See README: https://github.com/zerlok/python-bugs/tree/gino/enum-usage#troubles-with-gino-sqlalchemy-postgres-enum
Actual result
For 1 case
For 2 case
Environment (please complete the following information):
postgres:
11.10
Additional context
I described a full info in my repo (it was easier for my) and I provided the full environment (docker image and docker-compose) to reproduce this bug, look at my repo: https://github.com/zerlok/python-bugs/tree/gino/enum-usage.
The text was updated successfully, but these errors were encountered: