Skip to content
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

Changes to handle GTFS static data for MTA buses #1

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

cedarbaum
Copy link
Collaborator

This PR contains 2 changes to handle the GTFS data provided for MTA buses: http://web.mta.info/developers/developer-data-terms.html#data

  1. Make the transfers.txt file optional, as this is not included.
  2. Handle spaces around stop_lat/stop_lon in stops.txt.

Though these changes are in response to idiosyncrasies in the MTA bus static data, I believe they are generally useful for parsing in general, and thus are not so specific as to warrant an extension.

@jamespfennell
Copy link
Owner

Awesome, looks great! Really appreciate the unit testing too. Thank you!

I strongly agree with the overall philosophy that we should not be strict when parsing data from transit agencies. We should make the best out of what the agency sends us. It makes me think that we should perhaps always trim whitespace in the CSV files. But this change would have larger implications, so perhaps we can wait to see if the whitespace issue appears in other fields or agency data feeds, and then consider such a bigger change.

@jamespfennell jamespfennell merged commit 0159810 into jamespfennell:main Mar 8, 2023
@cedarbaum
Copy link
Collaborator Author

Thanks for the review! When you have time, could you also create a new release? I would like to potentially send a PR soon to integrate the MTA buses into Transiter, which will require this change.

@cedarbaum cedarbaum deleted the mta_buses branch March 8, 2023 07:10
@jamespfennell
Copy link
Owner

Done!

jamespfennell added a commit to jamespfennell/transiter that referenced this pull request Mar 27, 2023
Currently for async installs, the system is not marked as failed but instead as
installing. The bug is that the transaction function to mark the system
as failed returns the install error, so psql rolls back the transaction. We
instead need to return nil, so that the status change is commited.

This bug manifested as a client hang on a failed install which is pretty bad.

I discovered this while trying out the new MTA buses config that cedarbaum@
wrote. Install of this system fails as expected because of a seperate bug
in the GTFS library that was fixed by cedarbaum@ in
jamespfennell/gtfs#1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants