-
Notifications
You must be signed in to change notification settings - Fork 32
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
Trim header column names, added Metra test #152
Conversation
Metra would not load and I was getting complaints about that. The header looks like stop_id, stop_name, stop_desc, stop_lat, stop_lon, zone_id, stop_url, wheelchair_boarding and thus ` stop_name` is not eq to `stop_name`. This resolves this issue by trimming the header column names for every file. Metra Rail is added as a test to ensure this is working.
Nice finding. I’ll have to discuss a bit with people from https://github.com/etalab/transport-validator as such a bad file should yield an error on the validator, but still be easy to parse. Could you just make the metra gtfs a bit small (maybe trim the stops_times.txt filie) ? |
Sure! Let me take a look! |
Thank you for the change. We still need the file, just with a few lines |
Just a quick question. Would this change be O(n)? It's much simpler to check the separator, then invoke this change on an if statement. This would save about 2 billion steps if I am ingesting the World's GTFS data. |
The function (and even if we decided to trim each line, what might happen eventually, removing trailing white spaces is still quite cheap compared to parsing numbers) |
@Tristramg thoughts so far? |
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.
Thank you!
(I’m squashing with github to avoid having the larger file living in the history)
Looks like UK is now working with this now! |
Metra https://metra.com/metra-gtfs-api would not load and I was getting complaints about that. The header from stops.txt looks like
stop_id, stop_name, stop_desc, stop_lat, stop_lon, zone_id, stop_url, wheelchair_boarding and thus
stop_name
is not eq tostop_name
.This resolves this issue by trimming the header column names for every file.
Metra Rail is added as a test to ensure this is working.
The patch is bumped up a version to
0.39.1
.