Skip to content
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

SQLAlchemy 2.0 Compatibility #2483

Merged
merged 7 commits into from
Jul 29, 2024
Merged

Conversation

cjmayo
Copy link
Contributor

@cjmayo cjmayo commented Jul 26, 2024

Here are the SQLAlchemy 2.0 from #2467, which will pass here against 1.4...

@cjmayo cjmayo marked this pull request as draft July 26, 2024 19:13
dgilman and others added 4 commits July 27, 2024 17:26
LegacyAPIWarning: The Query.get() method is considered legacy as of the
1.x series of SQLAlchemy and becomes a legacy construct in 2.0.
The method is now available as Session.get() (deprecated since: 2.0)
Neither 'Column' object nor 'Comparator' object has an attribute 'not_between'
 >           db.engine.execute('CREATE EXTENSION IF NOT EXISTS citext')
 E           AttributeError: 'Engine' object has no attribute 'execute'
@cjmayo cjmayo marked this pull request as ready for review July 27, 2024 16:29
@samuelhwilliams
Copy link
Contributor

This would be great to get in 👍

Could we also please:

  • Remove the sqlalchemy warnings filtered out in pyproject.toml
  • Remove the <2 limitation in the sqlalchemy extra in pyproject.toml
  • Add a test run for py38-sqlalchemy1 and py312-sqlalchemy1 via tox, since after those changes above we'll be running against sqlalchemy >=2.0.0 by default

@cjmayo
Copy link
Contributor Author

cjmayo commented Jul 29, 2024

* Remove the sqlalchemy warnings filtered out in `pyproject.toml`

Done

* Remove the `<2` limitation in the `sqlalchemy` extra in `pyproject.toml`

Done

* Add a test run for py38-sqlalchemy1 and py312-sqlalchemy1 via tox, since after those changes above we'll be running against sqlalchemy >=2.0.0 by default

Thanks for this one - revealed I had broken test_multi_pk.py for SQLAlchemy 1. Also needed to restrict flaskmongoengine to use sqlalchemy1.

@samuelhwilliams
Copy link
Contributor

Great work, thank you :)

@samuelhwilliams samuelhwilliams merged commit 2d6dd16 into pallets-eco:master Jul 29, 2024
11 checks passed
@cjmayo cjmayo deleted the sqlalchemy-2 branch August 3, 2024 16:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants