-
Notifications
You must be signed in to change notification settings - Fork 513
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
Fix parsing of timestamp strings with missing fractional seconds; add unit test #185
Conversation
Current coverage is 74.32%@@ master #185 diff @@
==========================================
Files 62 62
Lines 2151 2158 +7
Methods 1983 1988 +5
Messages 0 0
Branches 168 170 +2
==========================================
+ Hits 1599 1604 +5
- Misses 552 554 +2
Partials 0 0
|
Thanks for fixing this! |
… unit test (#185) * Fix parsing of timestamp strings with missing fractional seconds; add unit test * fix silly line length requirement
@nevillelyh no problem! Thanks for putting this library together, it's already saved me far more time than it took me to make this little patch. cheers! kevin |
@mchalek good to hear! It'd be great if you can add something to this: https://github.com/spotify/scio/wiki/Powered-By |
… unit test (#185) * Fix parsing of timestamp strings with missing fractional seconds; add unit test * fix silly line length requirement
@nevillelyh we're currently in experimentation mode so we're not sure what we'll end up putting into production, but if we do end up using scio I'll try to remember to add us to the list! |
… unit test (#185) * Fix parsing of timestamp strings with missing fractional seconds; add unit test * fix silly line length requirement
… unit test (#185) * Fix parsing of timestamp strings with missing fractional seconds; add unit test * fix silly line length requirement
I have encountered a failure due to BigQuery returning timestamps with missing fractional seconds. In these instances, the timestamp parser throws an IllegalArgumentException because the expected pattern is "too short", e.g.:
Note that I received this error when querying tables that I generated using
scio-bigquery
, with input data that originally did not contain any fractional seconds. I'm not quite sure why BigQuery does not return zeros in the fractional second columns when they are queried, but this revision ensures that the parser does not break when this happens.I added a unit test for this condition, which will illustrate the failure when run without the changes to package.scala in place.