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

Lazily raise exceptions for missing data #3

Merged
merged 2 commits into from
Nov 27, 2012

Conversation

supaspoida
Copy link
Contributor

Wanted this so that I could work with data from NJ Transit without having to add empty missing source files. Commit has more details.

Cheers!

Lar Van Der Jagt added 2 commits October 7, 2012 20:46
This was passing because of a typo in the lambda. By specifying the
exception explicitly we ensure errors in test code don't mask errors in
the production code.
Previously a guard against missing files prevented you from using this
library even if your app doesn't require the missing data. This patch
changes the behavior to lazily raise exceptions only when accessing
missing data.

The motivation here is to make it easier to work with data as provided
by transit centers. Although google's spec lists `calendar.txt` as a
required file, MTA does not include it with their LIRR data
(http://bit.ly/WETHPD).  Instead they manage everything through
`calendar_dates.txt`. This patch allows us to make use of the data as
provided even if it doesn't conform to spec.
nerdEd added a commit that referenced this pull request Nov 27, 2012
Lazily raise exceptions for missing data
@nerdEd nerdEd merged commit eae0e3e into nerdEd:master Nov 27, 2012
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.

None yet

2 participants