Skip to content

False positives for duplicate_fare_rule_zone_id_fields in fare_rules.txt #1296

@isabelle-dr

Description

@isabelle-dr

Describe the bug

This was flagged by SDMTS.

False positives for the duplicate_fare_rule_zone_id_fields rule.
They only have (fare_id, route_id) fields defined, every row has a unique combination of both.
The spec mentions that the primary key for fare_rules.txt is (*) which means: all fields (reference)

They had duplicate_fare_rule_zone_id_fields triggered (which is an ERROR) and it looks like a problem with the way this rule is designed.

Steps/Code to Reproduce

  • download dataset provided
  • run validator
  • open report

Expected Results

No issue with fare rules

Actual Results

The notice duplicate_fare_rule_zone_id_fields is triggered 296 times.

Screenshots

No response

Files used

https://www.sdmts.com/google_transit_files/google_transit.zip

Validator version

4.0.0

Operating system

MacOS

Java version

No response

Additional notes

Now that we support multiple @PrimaryKey annotations, we don't need to have the duplicate_fare_rule_zone_id_fields rule in this validator at all.
We can use the @PrimaryKey annotation in fare_rules.txt directly, and the notice duplicate_key will be triggered if we have duplicate records.

Metadata

Metadata

Assignees

Labels

GTFS ReferenceUsed for Adding or changing rules that belong in the GTFS referencebugSomething isn't working (crash, a rule has a problem)status: ReadyAn issue that is ready to be worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions