Skip to content

Legacy API Fix#119

Open
jrblevin wants to merge 2 commits intoabsent1706:masterfrom
jrblevin:legacy-api-fix
Open

Legacy API Fix#119
jrblevin wants to merge 2 commits intoabsent1706:masterfrom
jrblevin:legacy-api-fix

Conversation

@jrblevin
Copy link
Copy Markdown

I received the following Legacy API Warning:

/.venv/lib/python3.12/site-packages/sqlalchemy_mixins/activerecord.py:91: 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) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)

This patch updates the SQLAlchemy 1.x style Class.query calls to use SQLAlchemy 2.0 style
Session.Query style calls. This removes the warning for me.

I have ran the test suite and all tests pass. I also noticed that greenlet was not included in the requirements-dev.txt file, so I have also included a commit to add it.

Updating SQLAlchemy 1.x series queries to SQLAlchemy 2.0 style
queries fixes the LegacyAPIWarning.
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

Successfully merging this pull request may close these issues.

1 participant