diff --git a/mod_ci/controllers.py b/mod_ci/controllers.py index 1414e1b0..7ad64bfb 100755 --- a/mod_ci/controllers.py +++ b/mod_ci/controllers.py @@ -2437,7 +2437,7 @@ def progress_type_request(log, test, test_id, request) -> bool: results = g.db.query(count(TestResultFile.got)).filter( and_( TestResultFile.test_id == test.id, - TestResultFile.regression_test_id.in_(results_zero_rc), + TestResultFile.regression_test_id.in_(results_zero_rc.select()), TestResultFile.got.isnot(None) ) ).scalar() @@ -2513,13 +2513,13 @@ def update_final_status(): finished_tests = g.db.query(TestProgress.test_id).filter( and_( TestProgress.status.in_([TestStatus.canceled, TestStatus.completed]), - TestProgress.test_id.in_(platform_tests) + TestProgress.test_id.in_(platform_tests.select()) ) ).subquery() in_progress_statuses = [TestStatus.preparation, TestStatus.completed, TestStatus.canceled] finished_tests_progress = g.db.query(TestProgress).filter( and_( - TestProgress.test_id.in_(finished_tests), + TestProgress.test_id.in_(finished_tests.select()), TestProgress.status.in_(in_progress_statuses) ) ).subquery() diff --git a/mod_customized/controllers.py b/mod_customized/controllers.py index c90cbc91..255ca23f 100755 --- a/mod_customized/controllers.py +++ b/mod_customized/controllers.py @@ -82,7 +82,7 @@ def index(): g.log.error('GitHub token not configured, cannot fetch commits') populated_categories = g.db.query(regressionTestLinkTable.c.category_id).subquery() - categories = Category.query.filter(Category.id.in_(populated_categories)).order_by(Category.name.asc()).all() + categories = Category.query.filter(Category.id.in_(populated_categories.select())).order_by(Category.name.asc()).all() tests = Test.query.filter(and_(TestFork.user_id == g.user.id, TestFork.test_id == Test.id)).order_by( Test.id.desc()).limit(50).all() diff --git a/mod_sample/controllers.py b/mod_sample/controllers.py index 5d315f5c..80455182 100755 --- a/mod_sample/controllers.py +++ b/mod_sample/controllers.py @@ -69,11 +69,11 @@ def display_sample_info(sample) -> Dict[str, Any]: sq = g.db.query(RegressionTest.id).filter(RegressionTest.sample_id == sample.id).subquery() 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)) + and_(TestResult.test_id == test_commit.id, TestResult.regression_test_id.in_(sq.select())) )).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)) + and_(TestResultFile.test_id == test_commit.id, TestResultFile.regression_test_id.in_(sq.select())) )).first() if exit_code is None and not_null is None: @@ -87,12 +87,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)) + and_(TestResult.test_id == test_release.id, TestResult.regression_test_id.in_(sq.select())) ) ).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)) + and_(TestResultFile.test_id == test_release.id, TestResultFile.regression_test_id.in_(sq.select())) )).first() if exit_code is None and not_null is None: diff --git a/mod_test/controllers.py b/mod_test/controllers.py index 67de3a4d..3d1aac2b 100644 --- a/mod_test/controllers.py +++ b/mod_test/controllers.py @@ -61,7 +61,7 @@ def get_test_results(test) -> List[Dict[str, Any]]: :type test: Test """ populated_categories = g.db.query(regressionTestLinkTable.c.category_id).subquery() - categories = Category.query.filter(Category.id.in_(populated_categories)).order_by(Category.name.asc()).all() + categories = Category.query.filter(Category.id.in_(populated_categories.select())).order_by(Category.name.asc()).all() results = [{ 'category': category, 'tests': [{