File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 33from geoalchemy2 import WKTElement
44from sqlalchemy import or_
55from sqlalchemy import select
6- from sqlalchemy .orm import joinedload , Session
6+ from sqlalchemy .orm import joinedload , Session , contains_eager
77from sqlalchemy .orm .query import Query
88from sqlalchemy .orm .strategy_options import _AbstractLoad
99
@@ -56,12 +56,17 @@ def get_gtfs_feeds_query(
5656 subquery , dataset_latitudes , dataset_longitudes , bounding_filter_method
5757 ).subquery ()
5858
59- feed_query = db_session .query (Gtfsfeed ).filter (Gtfsfeed .id .in_ (subquery ))
59+ feed_query = (
60+ db_session .query (Gtfsfeed )
61+ .outerjoin (Gtfsfeed .gtfsdatasets )
62+ .filter (Gtfsfeed .id .in_ (subquery ))
63+ .filter ((Gtfsdataset .latest ) | (Gtfsdataset .id == None )) # noqa: E711
64+ )
6065 if not include_wip :
6166 feed_query = feed_query .filter (Gtfsfeed .operational_status == "published" )
6267
6368 feed_query = feed_query .options (
64- joinedload (Gtfsfeed .gtfsdatasets )
69+ contains_eager (Gtfsfeed .gtfsdatasets )
6570 .joinedload (Gtfsdataset .validation_reports )
6671 .joinedload (Validationreport .notices ),
6772 * get_joinedload_options (),
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ resource "google_cloud_run_v2_service" "mobility-feed-api" {
7676 resources {
7777 limits = {
7878 cpu = " 1"
79- memory = " 1Gi "
79+ memory = " 2Gi "
8080 }
8181 }
8282 }
You can’t perform that action at this time.
0 commit comments