Skip to content

[FIX] Pass the select statement to in_() instead of calling .select() on it - #1254

Open
ARYAMANN7279 wants to merge 1 commit into
CCExtractor:masterfrom
ARYAMANN7279:fix/sqlalchemy-2-1-select-in
Open

ARYAMANN7279 wants to merge 1 commit into
CCExtractor:masterfrom
ARYAMANN7279:fix/sqlalchemy-2-1-select-in

Conversation

@ARYAMANN7279

Copy link
Copy Markdown

In raising this pull request, I confirm the following:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

My familiarity with the project is as follows:

  • I have never used the project.

The dependency update to SQLAlchemy 2.1 (#1251) fails on every Python version. Select.select() was deprecated in 1.4 and is removed in 2.1, so these calls raise AttributeError: 'Select' object has no attribute 'select':

  • mod_sample/controllers.py, display_sample_info: regression_test_id.in_(sq.select()), 4 times
  • mod_ci/controllers.py, the average time code: test_id.in_(platform_tests.select())

in_() accepts the select statement directly, so this passes it as it is. The query means the same thing, and it works on the pinned 2.0 and on 2.1.

I ran the whole test suite on Linux with Python 3.14. With SQLAlchemy 2.1.6 before this change: 5 failed (test_sample_pass, test_sample_fail, test_sample_id, test_sample_create_xml, test_progress_type_request). After: 807 passed. With the pinned 2.0.53: 807 passed before and after, and the SQLAlchemy deprecation warnings for these lines are gone.

Select.select() was deprecated in SQLAlchemy 1.4 and is gone in 2.1, so
the sample page and the test average time code fail with the version in
the dependency update PR. in_() accepts the select statement directly,
which also works with the pinned 2.0.
@sonarqubecloud

Copy link
Copy Markdown

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