-
Notifications
You must be signed in to change notification settings - Fork 258
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
Fix SQLAlchemy enum generation #363
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Alex Grönholm <[email protected]>
This needs a regression test and a changelog entry. |
OK, I'll add the changes to the Changes.rst As for a regression test - there's already a test that generates an enum (an intiial trial attempt caused it to fail). so it was passing all along, while differing from real world behavior which caused a differen enum statement to be generated. How would you like to tackle that? I can see if maybe a specific postgresql.ENUM dialect would trigger the error |
Yes, that would probably do the trick. IIRC I've used this technique elsewhere in the test suite when the generic types weren't reproducing the issues I wanted to fix. |
@agronholm so, I took a shot at it. This is not reproducible with the current set of unit tests (not for the I can confirm my fix solves the issues for both The only way I see to do a regression test for something like is by doing real integration / e2e tests against a dockerized PostgreSQL DB. But that's going to be a whole lot of work for a one line fix ( perhaps worth considering for the future) So, adding a test brings 0 value ATM on top of the current "fancy_types" one. If you know of way to have the dialect specific ENUM type survive metadata reflection, please let me know. If not, I suggest we merge this fix without adding a test. Added changes to change log, as you requested. |
Fixes #361