@@ -265,10 +265,10 @@ def process_report_filter(
265265 if report_filter .cleanupPlanNames :
266266 OR = []
267267 for cleanup_plan_name in report_filter .cleanupPlanNames :
268- q = select ([ CleanupPlanReportHash .bug_hash ] ) \
268+ q = select (CleanupPlanReportHash .bug_hash ) \
269269 .where (
270270 CleanupPlanReportHash .cleanup_plan_id .in_ (
271- select ([ CleanupPlan .id ] )
271+ select (CleanupPlan .id )
272272 .where (CleanupPlan .name == cleanup_plan_name )
273273 .distinct ()
274274 )) \
@@ -477,12 +477,12 @@ def get_include_skip_queries(
477477
478478 To get the include and skip lists use the 'get_component_values' function.
479479 """
480- include_q = select ([ File .id ] ) \
480+ include_q = select (File .id ) \
481481 .where (or_ (* [
482482 File .filepath .like (conv (fp )) for fp in include ])) \
483483 .distinct ()
484484
485- skip_q = select ([ File .id ] ) \
485+ skip_q = select (File .id ) \
486486 .where (or_ (* [
487487 File .filepath .like (conv (fp )) for fp in skip ])) \
488488 .distinct ()
@@ -1367,7 +1367,7 @@ def get_is_enabled_case(subquery):
13671367 ))
13681368
13691369 return case (
1370- [ (detection_status_filters , False )] ,
1370+ (detection_status_filters , False ),
13711371 else_ = True
13721372 )
13731373
@@ -1393,7 +1393,7 @@ def get_is_opened_case(subquery):
13931393 review_status_str , review_statuses )))
13941394 ]
13951395 return case (
1396- [ (and_ (* detection_and_review_status_filters ), True )] ,
1396+ (and_ (* detection_and_review_status_filters ), True ),
13971397 else_ = False
13981398 )
13991399
@@ -1850,9 +1850,9 @@ def getDiffResultsHash(self, run_ids, report_hashes, diff_type,
18501850 base_hashes , run_ids , tag_ids )
18511851
18521852 if self ._product .driver_name == 'postgresql' :
1853- new_hashes = select ([
1853+ new_hashes = select (
18541854 func .unnest (cast (report_hashes , ARRAY (String )))
1855- .label ('bug_id' )] ) \
1855+ .label ('bug_id' )) \
18561856 .except_ (base_hashes ).alias ('new_bugs' )
18571857 return [res [0 ] for res in session .query (new_hashes )]
18581858 else :
@@ -1865,10 +1865,10 @@ def getDiffResultsHash(self, run_ids, report_hashes, diff_type,
18651865 for chunk in util .chunks (
18661866 iter (report_hashes ), SQLITE_MAX_COMPOUND_SELECT ):
18671867 new_hashes_query = union_all (* [
1868- select ([ bindparam ('bug_id' + str (i ), h )
1869- .label ('bug_id' )] )
1868+ select (bindparam ('bug_id' + str (i ), h )
1869+ .label ('bug_id' ))
18701870 for i , h in enumerate (chunk )])
1871- q = select ([ new_hashes_query .subquery ()] ) \
1871+ q = select (new_hashes_query .subquery ()) \
18721872 .except_ (base_hashes )
18731873 new_hashes .extend ([
18741874 res [0 ] for res in session .query (q .subquery ())])
@@ -1983,10 +1983,10 @@ def getRunResults(self, run_ids, limit, offset, sort_types,
19831983
19841984 annotation_cols = OrderedDict ()
19851985 for col in annotation_keys :
1986- annotation_cols [col ] = func .max (sqlalchemy .case ([ (
1986+ annotation_cols [col ] = func .max (sqlalchemy .case ((
19871987 ReportAnnotations .key == col ,
19881988 cast (ReportAnnotations .value ,
1989- report_annotation_types [col ]["db" ]))] )) \
1989+ report_annotation_types [col ]["db" ])))) \
19901990 .label (f"annotation_{ col } " )
19911991
19921992 if report_filter .isUnique :
@@ -3960,7 +3960,7 @@ def getMissingContentHashes(self, file_hashes):
39603960 with DBSession (self ._Session ) as session :
39613961
39623962 q = session .query (FileContent ) \
3963- .options (sqlalchemy .orm .load_only (' content_hash' )) \
3963+ .options (sqlalchemy .orm .load_only (FileContent . content_hash )) \
39643964 .filter (FileContent .content_hash .in_ (file_hashes ))
39653965
39663966 return list (set (file_hashes ) -
@@ -3977,7 +3977,7 @@ def getMissingContentHashesForBlameInfo(self, file_hashes):
39773977 with DBSession (self ._Session ) as session :
39783978
39793979 q = session .query (FileContent ) \
3980- .options (sqlalchemy .orm .load_only (' content_hash' )) \
3980+ .options (sqlalchemy .orm .load_only (FileContent . content_hash )) \
39813981 .filter (FileContent .content_hash .in_ (file_hashes )) \
39823982 .filter (FileContent .blame_info .isnot (None ))
39833983
0 commit comments