Skip to content

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

Open
MrButtCode wants to merge 2 commits intoCCExtractor:masterfrom
MrButtCode:chore/db-deprecation-warnings
Open

chore(db): resolve SQLAlchemy scalar_subquery deprecation warnings#1052
MrButtCode wants to merge 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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 8, 2026

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