@@ -175,37 +175,6 @@ def get_datasets_with_missing_reports_query(
175175 return query
176176
177177
178- # def get_feeds_ids_with_missing_bounding_boxes_query(
179- # db_session: Session,
180- # ) -> Query:
181- # """
182- # Get GTFS feeds ids where the dataset is missing a bounding box.
183-
184- # Args:
185- # db_session: SQLAlchemy session
186-
187- # Returns:
188- # A SQLAlchemy query object for GTFS feeds with datasets missing bounding boxes
189- # ordered by dataset and feed stable id.
190- # """
191- # query = (
192- # db_session.query(
193- # Gtfsfeed.stable_id,
194- # Gtfsdataset.stable_id,
195- # )
196- # .select_from(Gtfsfeed)
197- # .join(Gtfsdataset, Gtfsdataset.feed_id == Gtfsfeed.id)
198- # .filter(Gtfsdataset.bounding_box.is_(None))
199- # .filter(
200- # ~Gtfsfeed.feedlocationgrouppoints.any()
201- # ) # Only feeds with no location group points
202- # .distinct(Gtfsfeed.stable_id, Gtfsdataset.stable_id)
203- # .order_by(Gtfsdataset.stable_id, Gtfsfeed.stable_id)
204- # )
205-
206- # return query
207-
208-
209178def get_feeds_with_missing_bounding_boxes_query (
210179 db_session : Session ,
211180) -> Query :
@@ -222,6 +191,7 @@ def get_feeds_with_missing_bounding_boxes_query(
222191 query = (
223192 db_session .query (Gtfsfeed )
224193 .join (Gtfsdataset , Gtfsdataset .feed_id == Gtfsfeed .id )
194+ .filter (Gtfsdataset .latest .is_ (True ))
225195 .filter (Gtfsdataset .bounding_box .is_ (None ))
226196 .filter (~ Gtfsfeed .feedlocationgrouppoints .any ())
227197 .distinct (Gtfsfeed .stable_id , Gtfsdataset .stable_id )
0 commit comments