-
Notifications
You must be signed in to change notification settings - Fork 911
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
[BUG] cudf.to_datetime with arg with Z
drops UTC offset incorrectly
#14039
Comments
…ring (#14074) closes #14039 Avoids this discrepancy when a date string has a tz component ```python In [1]: import pandas In [2]: import cudf In [3]: data = ["2019-01-01T00:00:00.000Z"] In [4]: cudf.to_datetime(data) Out[4]: DatetimeIndex(['2019-01-01'], dtype='datetime64[ns]') In [5]: pandas.to_datetime(data) Out[5]: DatetimeIndex(['2019-01-01 00:00:00+00:00'], dtype='datetime64[ns, UTC]', freq=None) ``` Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) - Vyas Ramasubramani (https://github.com/vyasr) URL: #14074
This is exactly how it should work. Adding Z does not change the timezone. All time data should be assumed to be in UTC unless otherwise specified by a timezone offset. Throwing an exception is not appropriate and is a breaking change that is effecting nv-morpheus/morpheus as we try to update to newer versions of CUDF. |
Pandas differentiates between "naive" datetimes and timezone-aware datetimes. In pandas, parsing a We are temporarily reverting this change of behavior in #14701 when cuDF is used with pandas compatibility mode turned off. See my proposal for a deprecation step followed by a behavior change in cuDF here: #14701 (review) |
xref #14039 (comment) Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - Christopher Harris (https://github.com/cwharris) - Bradley Dice (https://github.com/bdice) URL: #14701
Describe the bug
cudf.to_datetime with arg with
Z
drops UTC offset incorrectlySteps/Code to reproduce bug
Expected behavior
Since cudf does not support timezones currently, I would expect this to raise a
NotImplementedError
It appears there was a commit that tried to address this, 9508210, but it looks to simply ignore "Z"
Environment overview (please complete the following information)
docker pull
&docker run
commands usedEnvironment details
Please run and paste the output of the
cudf/print_env.sh
script here, to gather any other relevant environment detailsAdditional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: