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

[BUG] Components of DatetimeIndex that is tz-aware should be based on local not UTC time #14077

Closed
mroeschke opened this issue Sep 11, 2023 · 0 comments
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@mroeschke
Copy link
Contributor

Describe the bug
Components of DatetimeIndex that is tz-aware should be based on local not UTC time

Steps/Code to reproduce bug

In [1]: from cudf import *

In [2]:         ts = ["2008-05-12 13:50:00", "2008-12-12 14:50:35", "2009-05-12 13:50:32"]
   ...:         tt = DatetimeIndex(ts).tz_localize("UTC")

In [5]: ut = tt.tz_convert("US/Eastern")

In [6]: ut
Out[6]: 
DatetimeIndex(['2008-05-12 09:50:00-04:00', '2008-12-12 09:50:35-05:00',
               '2009-05-12 09:50:32-04:00'],
              dtype='datetime64[ns, US/Eastern]')

In [7]: ut.hour
Out[7]: Int16Index([13, 14, 13], dtype='int16')

Expected behavior

In [7]: ut.hour
Out[7]: Int16Index([9, 9, 9], dtype='int16')

Environment overview (please complete the following information)

  • Environment location: Bare-metal
  • Method of cuDF install: conda
    • If method of install is [Docker], provide docker pull & docker run commands used

Environment details
Please run and paste the output of the cudf/print_env.sh script here, to gather any other relevant environment details

Additional context
Add any other context about the problem here.

@mroeschke mroeschke added bug Something isn't working Needs Triage Need team to review and classify Python Affects Python cuDF API. and removed Needs Triage Need team to review and classify labels Sep 11, 2023
@mroeschke mroeschke self-assigned this Sep 27, 2023
@shwina shwina closed this as completed Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Affects Python cuDF API.
Projects
None yet
Development

No branches or pull requests

1 participant