-
Notifications
You must be signed in to change notification settings - Fork 912
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
Raise NotImplementedError for to_datetime with z format #14037
Changes from 1 commit
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 | ||||
---|---|---|---|---|---|---|
|
@@ -2148,3 +2148,11 @@ def test_daterange_pandas_compatibility(): | |||||
"2010-01-01", "2010-02-01", periods=10, name="times" | ||||||
) | ||||||
assert_eq(expected, actual) | ||||||
|
||||||
|
||||||
@pytest.mark.parametrize("code", ["z", "Z"]) | ||||||
def test_format_timezone_not_implemented(code): | ||||||
with pytest.raises(NotImplementedError): | ||||||
cudf.to_datetime( | ||||||
["2020-01-01 00:00:00 UTC"], format=f"%Y-%m-%d %H-%M-%S %{code}" | ||||||
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.
Suggested change
Format string doesn't match the provided date string without it (and once timezones are implemented, we would expect this test to 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. Thanks for the catch |
||||||
) |
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.
Note: This is fine, but I'll just note that
%%Z
is a valid string forstrptime
that means "look for a literal%Z
". So this replacement (and the existing%f
replacement) is not robust against some of the wackier formats a user might provide.