-
Notifications
You must be signed in to change notification settings - Fork 84
db: add sqlalchemy 2.0 support #1317
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
Conversation
78a7f5c
to
cf12986
Compare
ad29841
to
15fcaee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only spotted one potential issue. The rest looks good though we'll surely spot other issues when we resolve the autocommit thing and use SQLAlchemy 2.x (and oslo.db 13.x).
Out of curiosity, would it be worth enabling warnings in our test like we've done for most OpenStack projects?
Thanks, yeah the autocommit part will really suck when it hits there is no real control of the transactions so more cleanup required there, the testing right now actually uses SQAlchemy 2.x and newer oslo.db already because we have unpinned dependencies that is not restricted by any upper-constraints. I did look into enabling warnings with a warnings fixtures to the tests, used it while doing this work but didn't get any noticeable warnings except for the autocommit IIRC. I opted for unpinning SQLAlchemy pinning and instead add a separate SQLAlchemy 1.4 job to make sure we don't break >=1.4<2 users. |
we are already in a transaction because of autobegin.
d271289
to
315c730
Compare
the _and() and _or() clause operators need atleast one argument since sqlalchemy 1.4
the 7.0 version removed support for setuptools with the removal of the setup_command module.
cca5d4b
to
3210e94
Compare
this was introduced in 1.4 and it's our minimum now so we can drop our compat code.
3210e94
to
126a5a5
Compare
Oh really? I wonder how it's working though since autocommit isn't available in SQLAlchemy 2.x (at least outside of driver-level implementations). Weird.
Sounds good. |
I wish I had an answer for that but really I'm just glad it even works, I'm hoping nothing major is overlooked and that it actually works as well, it's still unreleased code so atleast not a catastrophe if this were to break someones CI.
Do you have any other feedback for this or do you approve? |
Nope, no other feedback. This looks good to me as-is now. |
This adds support for SQLAlchemy 2.0 but does not solve the removal of autocommit which will need to be handled in the future.