@@ -89,11 +89,9 @@ def remove_unused_files(product):
8989 product .endpoint )
9090 try :
9191 bpe_files = session .query (BugPathEvent .file_id ) \
92- .group_by (BugPathEvent .file_id ) \
93- .subquery ()
92+ .group_by (BugPathEvent .file_id )
9493 brp_files = session .query (BugReportPoint .file_id ) \
95- .group_by (BugReportPoint .file_id ) \
96- .subquery ()
94+ .group_by (BugReportPoint .file_id )
9795
9896 files_to_delete = session .query (File .id ) \
9997 .filter (File .id .notin_ (bpe_files ), File .id .notin_ (brp_files ))
@@ -111,8 +109,7 @@ def remove_unused_files(product):
111109 LOG .debug ("%d dangling files deleted." , total_count )
112110
113111 files = session .query (File .content_hash ) \
114- .group_by (File .content_hash ) \
115- .subquery ()
112+ .group_by (File .content_hash )
116113
117114 session .query (FileContent ) \
118115 .filter (FileContent .content_hash .notin_ (files )) \
@@ -137,8 +134,7 @@ def remove_unused_comments(product):
137134 .join (Report ,
138135 Comment .bug_hash == Report .bug_id ,
139136 isouter = True ) \
140- .filter (Report .id .is_ (None )) \
141- .subquery ()
137+ .filter (Report .id .is_ (None ))
142138 count = session .query (Comment ) \
143139 .filter (Comment .id .in_ (sub )) \
144140 .delete (synchronize_session = False )
@@ -192,8 +188,7 @@ def remove_unused_analysis_info(product):
192188 isouter = True ) \
193189 .filter (
194190 RunHistoryAnalysisInfo .c .analysis_info_id .is_ (None ),
195- ReportAnalysisInfo .c .analysis_info_id .is_ (None )) \
196- .subquery ()
191+ ReportAnalysisInfo .c .analysis_info_id .is_ (None ))
197192
198193 count = session .query (AnalysisInfo ) \
199194 .filter (AnalysisInfo .id .in_ (to_delete )) \
0 commit comments