-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GTFS Flex spec update: separate columns for location_id
, location_group_id
#5564
GTFS Flex spec update: separate columns for location_id
, location_group_id
#5564
Conversation
location_id
, location_group_id
location_id
, location_group_id
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5564 +/- ##
=============================================
+ Coverage 67.35% 67.38% +0.02%
- Complexity 16162 16169 +7
=============================================
Files 1858 1858
Lines 71093 71095 +2
Branches 7403 7399 -4
=============================================
+ Hits 47888 47904 +16
+ Misses 20745 20732 -13
+ Partials 2460 2459 -1 ☔ View full report in Codecov by Sentry. |
027e99d
to
a3d8518
Compare
src/test/java/org/opentripplanner/gtfs/mapping/StopTimeMapperTest.java
Outdated
Show resolved
Hide resolved
eeab611
to
c259b34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need a bit of context regarding the changes in onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/StopTime.java, notably the difference between the getters getStop(), getLocation(), .. that go through StopTimeProxy and getStopLocation() that does not go through that proxy.
"Nested GroupStops are not allowed" | ||
); | ||
case null, default -> throw new RuntimeException( | ||
"Unknown location type: " + location.getClass().getSimpleName() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
location.getClass() triggers a NullPointerException if location == null
Is "case null" actually a possible code path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've cleaned this up here:
8c3411c
I made the null check more explicit and added a nicer error message.
src/test/java/org/opentripplanner/gtfs/mapping/StopTimeMapperTest.java
Outdated
Show resolved
Hide resolved
I'm not really sure what the proxy is used for but it only exists for getters for which there is a proper column in GTFS. The |
Summary
At the latest GTFS Flex working group we decided that we want to put
location_id
andlocation_group_id
into their separate columns in order to make it clearer what is a flex trip and what isn't.This PR catches up with this spec change and uses some Java 21 features to clean up the code a little.
Lastly, since the stop_id column can now be empty, I added
Unit tests
✔️
cc @westontrillium @tzujenchanmbd @tsherlockcraig @eliasmbd @gcamp