From 58dd48826d9c3b9f5da2fb95c1e7bbeb6fb27c33 Mon Sep 17 00:00:00 2001 From: AryamannSrivastava Date: Mon, 26 Oct 2026 23:17:45 +0530 Subject: [PATCH] Pass the select statement to in_() instead of calling .select() on it 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. --- mod_ci/controllers.py | 2 +- mod_sample/controllers.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mod_ci/controllers.py b/mod_ci/controllers.py index 591284737..2d81a713b 100755 --- a/mod_ci/controllers.py +++ b/mod_ci/controllers.py @@ -2640,7 +2640,7 @@ def update_final_status(): finished_tests = select(TestProgress.test_id).filter( and_( TestProgress.status.in_([TestStatus.canceled, TestStatus.completed]), - TestProgress.test_id.in_(platform_tests.select()) + TestProgress.test_id.in_(platform_tests) ) ) times = g.db.query( diff --git a/mod_sample/controllers.py b/mod_sample/controllers.py index 7b3d5d85a..dc3ef161f 100755 --- a/mod_sample/controllers.py +++ b/mod_sample/controllers.py @@ -70,11 +70,11 @@ def display_sample_info(sample) -> Dict[str, Any]: sq = select(RegressionTest.id).filter(RegressionTest.sample_id == sample.id) exit_code = g.db.query(TestResult.exit_code).filter(and_( TestResult.exit_code != TestResult.expected_rc, - and_(TestResult.test_id == test_commit.id, TestResult.regression_test_id.in_(sq.select())) + and_(TestResult.test_id == test_commit.id, TestResult.regression_test_id.in_(sq)) )).first() not_null = g.db.query(TestResultFile.got).filter(and_( TestResultFile.got.isnot(None), - and_(TestResultFile.test_id == test_commit.id, TestResultFile.regression_test_id.in_(sq.select())) + and_(TestResultFile.test_id == test_commit.id, TestResultFile.regression_test_id.in_(sq)) )).first() if exit_code is None and not_null is None: @@ -88,12 +88,12 @@ def display_sample_info(sample) -> Dict[str, Any]: exit_code = g.db.query(TestResult.exit_code).filter( and_( TestResult.exit_code != TestResult.expected_rc, - and_(TestResult.test_id == test_release.id, TestResult.regression_test_id.in_(sq.select())) + and_(TestResult.test_id == test_release.id, TestResult.regression_test_id.in_(sq)) ) ).first() not_null = g.db.query(TestResultFile.got).filter(and_( TestResultFile.got.isnot(None), - and_(TestResultFile.test_id == test_release.id, TestResultFile.regression_test_id.in_(sq.select())) + and_(TestResultFile.test_id == test_release.id, TestResultFile.regression_test_id.in_(sq)) )).first() if exit_code is None and not_null is None: