Skip to content

chore(db): resolve SQLAlchemy scalar_subquery deprecation warnings#1052

Merged
canihavesomecoffee merged 2 commits intoCCExtractor:masterfrom
MrButtCode:chore/db-deprecation-warnings
Mar 12, 2026
Merged

chore(db): resolve SQLAlchemy scalar_subquery deprecation warnings#1052
canihavesomecoffee merged 2 commits intoCCExtractor:masterfrom
MrButtCode:chore/db-deprecation-warnings

Conversation

@MrButtCode
Copy link

Resolves multiple SAWarning deprecation warnings generated by SQLAlchemy during the test suite execution.

In newer versions of SQLAlchemy, coercing a Subquery object into a select() for use in an IN() clause throws a deprecation warning: "SAWarning: Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly".

To resolve this and modernize the database queries, I updated the .subquery() calls to .scalar_subquery() across mod_ci, mod_customized, mod_sample, and mod_test where they are explicitly used inside .in_() filters. This eliminates the warnings during the test run and ensures future compatibility with SQLAlchemy 2.0 paradigms.

@canihavesomecoffee canihavesomecoffee force-pushed the chore/db-deprecation-warnings branch from 7953ef8 to 9c74f52 Compare March 12, 2026 12:50
@sonarqubecloud
Copy link

@canihavesomecoffee canihavesomecoffee merged commit c6ba18d into CCExtractor:master Mar 12, 2026
9 of 10 checks passed
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.

2 participants