-
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
fix(orca-fares): remove fare attributes with no rules #6089
fix(orca-fares): remove fare attributes with no rules #6089
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6089 +/- ##
=============================================
+ Coverage 69.82% 69.84% +0.02%
- Complexity 17419 17462 +43
=============================================
Files 1974 1974
Lines 74545 74606 +61
Branches 7633 7640 +7
=============================================
+ Hits 52048 52107 +59
- Misses 19847 19850 +3
+ Partials 2650 2649 -1 ☔ View full report in Codecov by Sentry. |
@@ -40,6 +40,15 @@ public Set<RouteOriginDestination> getRouteOriginDestinations() { | |||
return routeOriginDestinations; | |||
} | |||
|
|||
public boolean hasRules() { |
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.
This one needs Javadoc and a test.
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.
Good point, I added tests for this and matches
.
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.
That's a very nice test but where is the Javadoc?
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.
Oops
f96de66
to
7cfb806
Compare
7cfb806
to
feedefe
Compare
new HashSet<>(), | ||
new HashSet<>(), |
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.
new HashSet<>(), | |
new HashSet<>(), | |
Set.of(), | |
Set.of() |
I find this visually a bit more pleasing. Not a big issue though.
023a39b
to
364cf4f
Compare
66dbc18
to
54223b1
Compare
Only sandbox code. Merging with a single review. |
Summary
ORCA agencies have occasionally left in fare attributes with no associated rules. OTP will match these against any leg, and if the fare is lower than the correct fare, it will take priority. There does not seem to be a well defined behavior for this edge case in the GTFS spec, but to avoid changing the behavior of OTP in general, I have added a one liner to remove these fare attributes lacking rules when using the ORCA fare module.
Unit tests
I'm not sure how to test this or if it's necessary, since this change happened in the ORCA fare factory which is untested.