Repository navigation
fix: give GTFS-RT feeds their own location group rows - #1903
Merged
Merged
Conversation
Reverse geolocation reused the schedule feed's feedosmlocationgroup rows for its realtime feeds, which moved them to the last realtime feed and made later runs fail. Each feed now gets its own rows, stale groups are deleted, and a changeset backfills realtime feeds from their schedule feeds.
cka-y
marked this pull request as ready for review
November 16, 2026 14:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
update_feed_locationgave a schedule feed's GTFS-RT feeds the schedule feed's ownfeedosmlocationgroupobjects. With the delete-orphan cascade onFeed.feedosmlocationgroups, a schedule feed with realtime feeds gets no location groups, and neither do its realtime feeds. Rows that already existed move to the realtime feed on the next run and are dropped on the run after. Found while reviewing #1884.Active feeds on prod:
So 99% of active realtime feeds whose schedule feed was geolocated have no location groups.
fix_rt_feed_location_groups.sqlcopies schedule feeds' groups to their realtime feeds.reverse_geolocation_batchwithinclude_only_unprocessed: false: the affected schedule feeds already have stop points, so the default run skips them.Expected behavior:
After reverse geolocation, a schedule feed and each of its realtime feeds have the same location groups.
Testing tips:
./scripts/api-tests.sh --folder functions-python/reverse_geolocation. The new test fails onmain../scripts/api-tests.shto make sure you didn't break anything