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 Deprecation / Legacy Warning About Query.get() #361

Open
rosensama opened this issue Jan 26, 2025 · 0 comments
Open

SQLAlchemy 2.0 Deprecation / Legacy Warning About Query.get() #361

rosensama opened this issue Jan 26, 2025 · 0 comments

Comments

@rosensama
Copy link

Thanks for the great tool. I moved a project using it to SQLA 2.0 this year and have been monitoring for deprecation warnings. Here's one related to sqlalchemy-continuum. I added white space for readability.

/lib/python3.13/site-packages/sqlalchemy_continuum/plugins/transaction_changes.py:80: SAWarning: 
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) 
(Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) 
(This warning originated from the Session 'autoflush' process, which was invoked automatically in 
response to a user-initiated operation. Consider using ``no_autoflush`` context manager if this 
warning happended while initializing objects.)
  changes = session.query(self.model_class).get(params)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant