Skip to content

feat: Validation for conditionally required/forbidden fare_rules.txt file.#1261

Closed
bdferris-v2 wants to merge 5 commits intoMobilityData:masterfrom
bdferris-v2:issue/1201/fares-v1
Closed

feat: Validation for conditionally required/forbidden fare_rules.txt file.#1261
bdferris-v2 wants to merge 5 commits intoMobilityData:masterfrom
bdferris-v2:issue/1201/fares-v1

Conversation

@bdferris-v2
Copy link
Copy Markdown
Collaborator

Summary:

Per updates introduced in the Fares v2 spec addition, we now check for the conditionally required/forbidden fare_rules.txt file.

Please make sure these boxes are checked before submitting your pull request - thanks!

@bdferris-v2 bdferris-v2 linked an issue Oct 3, 2022 that may be closed by this pull request
@bdferris-v2
Copy link
Copy Markdown
Collaborator Author

@isabelle-dr per discussion, here is a separate PR for the Fares v1 file checks.

Copy link
Copy Markdown
Contributor

@KClough KClough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@isabelle-dr isabelle-dr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 minor changes in line.
Can you resolve the merge conflicts?
Then, I'll merge this PR!

@bdferris-v2
Copy link
Copy Markdown
Collaborator Author

@merge conflicts have been resolved

@isabelle-dr isabelle-dr added this to the v4.0 milestone Oct 4, 2022
@bdferris-v2
Copy link
Copy Markdown
Collaborator Author

Pasting this in manually:

❌ Invalid acceptance test.
New Errors: 62 out of 1363 datasets (~5%) are invalid due to code change, which is above the provided threshold of 1%.
Dropped Errors: 0 out of 1363 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
1 out of 1364 sources (~0 %) are corrupted.
Corrupted sources:
de-unknown-ulmer-eisenbahnfreunde-gtfs-1081
Commit: e0746f5
Download the full acceptance test report here (report will disappear after 90 days).
❌ Invalid acceptance test.

I was curious what this was going to trigger. Taking a closer look.

@isabelle-dr
Copy link
Copy Markdown
Contributor

isabelle-dr commented Oct 4, 2022

Isn't having fare_rules.txt going from Optional to "Required if fare_attributes.txt is defined" (which was a pre-existing Optional file), a breaking change?
I'm not surprised that we have some existing datasets becoming invalid.

@bdferris-v2
Copy link
Copy Markdown
Collaborator Author

I'm a little confused by the change to the spec as well.

Looking back at the original Fares V1 example documentation (not really hosted anywhere anymore, but available at https://web.archive.org/web/20111207224351/https://code.google.com/p/googletransitdatafeed/wiki/FareExamples), having a fare_attributes.txt file with a single entry and no fare_rules.txt file was a supported use-case for systems that have a single base fare. This was actually brought up in a comment by @flocsy but I think his feedback was ignored?

And indeed, when I look through the acceptance report for this change, there are 62 feeds in the MobilityDatabase that have a fare_attributes.txt file but no fare_rules.txt file. Of those, 39 have a single entry in fare_attributes.txt, indicating a default fare.

That said, there are also 11 feeds where fare_attributes.txt has no entires (but still has a CSV row header). I'm not sure how that should be interpreted? A free fare? There are additionally 10 feeds that specify multiple fare_attributes.txt entries where fare_rules.txt looks like should legitimately be specified.

I'm tempted to say "pause" on this PR and get some feedback from the #gtfs-fares group before proceeding.

@isabelle-dr isabelle-dr added need spec clarification Needs a modification in the specification status: Blocked Can't work on it currently because of an external factor. labels Oct 5, 2022
@isabelle-dr
Copy link
Copy Markdown
Contributor

@bdferris-v2 I am closing this since we decided to modify the spec and not the validator for this one.
We can eventually keep the addition of forbidden_file to use in other cases. I'll let you decide if you'd like to open another PR for it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need spec clarification Needs a modification in the specification status: Blocked Can't work on it currently because of an external factor.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rules for the Fares v2 base implementation

3 participants