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

in2csv for ndjson breaks when first line contains "yesterday" #1094

Closed
pokey opened this issue Oct 14, 2020 · 3 comments
Closed

in2csv for ndjson breaks when first line contains "yesterday" #1094

pokey opened this issue Oct 14, 2020 · 3 comments

Comments

@pokey
Copy link

pokey commented Oct 14, 2020

➜ in2csv --version
in2csv 1.0.5

➜ printf '{"foo":"yesterday"}' | in2csv -f ndjson
OverflowError: date value out of range

➜ printf '{"foo":"hello"}\n{"foo":"yesterday"}' | in2csv -f ndjson
foo
hello
yesterday
@pokey
Copy link
Author

pokey commented Oct 14, 2020

Fwiw it looks like a workaround is to use the --no-inference flag

@jpmckinney
Copy link
Member

Hmm, it's because the sourceTime given to parsedatetime by agate is the minimum date, and "yesterday" puts that beyond the minimum. It's from a very old commit: wireservice/agate@eded6f5 I don't know why the sourceTime isn't today (it'd make sense for "yesterday", but maybe not for other times).

@jpmckinney
Copy link
Member

jpmckinney commented Mar 10, 2021

I've released agate 1.6.2 which should fix this: wireservice/agate#720 I tested with:

printf '{"foo":"yesterday"}' | in2csv -f ndjson

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

No branches or pull requests

2 participants