Repository navigation
Stop calling deprecated APIs and refresh dependencies - #43
Merged
Merged
Conversation
The shared SQL base called session.execute() 40 times. SQLModel's AsyncSession deprecates it, so every consumer using that session class, one of the two setups the docs offer, got a DeprecationWarning from our internals, and those treating warnings as errors failed outright. exec() cannot replace it because a plain SQLAlchemy session has none and the base serves both, so the calls go through a helper that invokes SQLAlchemy's execute() directly. SQLModel's override only delegates to it. Redis writes move from setex to set(ex=), deprecated since redis-py 2.6.12. This reached an application rather than CI because no test built a session with SQLModel's AsyncSession, so the adapter contract now runs against both documented session classes. With that in place the suite treats deprecations as errors and needs no ignore entries. Dependencies verified against the newest releases, including uuid-utils 1.0 and SQLModel 0.0.47. Declared floors are unchanged; nothing requires a newer version.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solves the deprecations rather than suppressing them, so downstream applications running warnings-as-errors do not need an ignore for this library.
What was wrong
_BaseSQLAlchemyAdaptercalledsession.execute()40 times. SQLModel'sAsyncSessiondeprecates it, anddocs/adapters/sqlmodel.mdoffers that session class as one of two supported setups.setex, deprecated since redis-py 2.6.12.AsyncSession, so the SQLModel path had no coverage, and deprecations were not errors.Changes
execute()directly.exec()cannot be used: a plain SQLAlchemy session has none, and the base serves both adapters. SQLModel's override does nothing but delegate, so behaviour is identical and results stayRowobjects.setexbecomesset(..., ex=).class_=AsyncSessionfrom SQLModel. Verified it bites: reverting the helper fails 30 of those tests and none of the SQLAlchemy ones, which is precisely why the bug escaped.filterwarnings = ["error::DeprecationWarning", "error::PendingDeprecationWarning"], with no ignore entries.uv lock --upgrade, verified against uuid-utils 1.0, SQLModel 0.0.47, SQLAlchemy 2.0.54, PyJWT 2.15, Starlette 1.7, pymdown-extensions 12.Version floors
Left unchanged deliberately. For a library the floor states the oldest release it works with, not the newest it was tested against; raising it forces consumers to upgrade for no benefit. Nothing here needs a newer version, including uuid-utils 1.0, whose result we convert via
bytes.Checks
ruff, ruff format, mypy --strict, pytest (588 passed on 3.14, 587 on 3.10), mkdocs build --strict.