-
Notifications
You must be signed in to change notification settings - Fork 6
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: raise ValueError if date is out-of-bounds #46
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,13 +183,13 @@ def types_mapper( | |
type=pyarrow.time64("us"), | ||
), | ||
), | ||
( | ||
# Only microseconds are supported when reading data. See: | ||
# https://github.com/googleapis/python-db-dtypes-pandas/issues/19 | ||
# Still, round-trip with pyarrow nanosecond precision scalars | ||
# is supported. | ||
pytest.param( | ||
pandas.Series( | ||
[ | ||
# Only microseconds are supported when reading data. See: | ||
# https://github.com/googleapis/python-db-dtypes-pandas/issues/19 | ||
# Still, round-trip with pyarrow nanosecond precision scalars | ||
# is supported. | ||
pyarrow.scalar(0, pyarrow.time64("ns")), | ||
pyarrow.scalar( | ||
12 * HOUR_NANOS | ||
|
@@ -216,6 +216,21 @@ def types_mapper( | |
], | ||
type=pyarrow.time64("ns"), | ||
), | ||
id="time-nanoseconds-arrow-round-trip", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leftover from debugging why when I made the "time" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test ID is indeed useful IMO. 👍 |
||
), | ||
pytest.param( | ||
pandas.Series( | ||
["0:0:0", "12:30:15.123456789", "23:59:59.999999999"], dtype="dbtime", | ||
), | ||
pyarrow.array( | ||
[ | ||
0, | ||
12 * HOUR_NANOS + 30 * MINUTE_NANOS + 15 * SECOND_NANOS + 123_456_789, | ||
23 * HOUR_NANOS + 59 * MINUTE_NANOS + 59 * SECOND_NANOS + 999_999_999, | ||
], | ||
type=pyarrow.time64("ns"), | ||
), | ||
id="time-nanoseconds-arrow-from-string", | ||
), | ||
] | ||
|
||
|
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.
Towards #19
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.
Probably should have been a separate PR, but I noticed
_datetime
had inconsistent types (sometimes pandas.Timestamp, sometime datetime.datetime, sometime numpy.datetime64). We want anumpy.datetime64
in the end, so I unified it.