duplicate_key error with fare_attributes when using multiple agencies #1916
Replies: 3 comments
-
Pinging @emmambd to make sure this doesn't slip through the cracks :-) |
Beta Was this translation helpful? Give feedback.
-
Hello @ttaylor-avail, thank you for reaching out.
|
Beta Was this translation helpful? Give feedback.
-
Thank you for the response. I understand v2 is the focus, and I'll live with that. I ended up putting a work around in place, by appending the agency id to the fare id to make it unique. In regards to item 1. I understand what I outlined might be the behavior, but I disagree with it being "correct". Have a good weekend @skalexch and @sylvansson |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is my first time interacting with this community. I wasn't sure if I should post this as an issue, or start here and wait for a suggestion. So here I am.
I'm receiving duplicate_key validation errors when I include multiple agencies in my fare_attributes.txt file, specifically when the same fare_id is used by more then one agency. I would assume if multiple agencies were listed in the file, the agency_id would also be included as part of the PK when determining duplicate keys.
I'm updating my GTFS export code to better support the consolidation of multiple agencies. Various unique IDs across the schedule set are be appended with an agency identifier. In the case of the fare_attributes file, I didn't think appending that same agency identifier to the fare_id field should be necessary since the agency_id is already a field.
Example output with duplicate_key validation errors:
fare_id,price,currency_type,payment_method,transfers,agency_id,transfer_duration
1,0.00,USD,0,0,0,0
2,0.00,USD,1,0,0,0
3,0.00,USD,1,0,0,0
4,0.00,USD,1,0,0,0
5,0.00,USD,1,0,0,0
1,0.00,USD,0,0,2,0
2,0.00,USD,0,0,2,0
3,0.00,USD,0,0,2,0
4,0.00,USD,0,0,2,0
5,0.00,USD,0,0,2,0
Beta Was this translation helpful? Give feedback.
All reactions