-
Notifications
You must be signed in to change notification settings - Fork 100
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: Drop DuplicateFareRuleZoneIdFieldsValidator and replace with multi-column @PrimaryKey for fare_rules.txt #1297
Conversation
…ecified multi-column @PrimaryKey for fare_rules.txt
❌ Invalid acceptance test. |
Thanks for working on this @bdferris-v2! |
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.
Can you remove the outdated rule from the documentation, please?
Then we are good to merge this PR :)
RULES.md has been updated. |
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.
Thanks! I think we are good to merge without an additional code review here.
❌ Invalid acceptance test. |
Closes #1296.
Per discussion in #1296,
DuplicateFareRuleZoneIdFieldsValidator
says the combination ofroute_id
,origin_id
,destination_id
, andcontains_id
must be unique infare_rules.txt
, when the spec saysfare_id
should be included (aka the primary key is all fields). This PR drops the custom validator in favor of proper @PrimaryKey annotations forfare_rules.txt
.Per the acceptance tests, there are a number of feeds (~60) that trigger the existing
duplicate_fare_rule_zone_id_fields
notice. Spot checking a few feeds, many of them are indeed specifying the same combination of fare rules with different fare ids. The corresponding fare attributes often have a different price, probably indicating that the producer is attempting to model some other aspect of their fare system (different fare products? different rider categories?) despite the fact that this is not really supported in Fares v1. While it's maybe not obvious how feed consumers should productively use this data, other than showing the cheapest fare, the spec technically allows it, so the validator should as well.The acceptance test shows that a number of feeds (~10) newly trigger a
duplicate_key
notice. These are all feeds that really due have a duplicate combination of all fields infare_rules.txt
. However, each of these feeds were already triggering aduplicate_fare_rule_zone_id_fields
notice, so there are no newly-invalidated feeds from this change.gradle test
to make sure you didn't break anything