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] astype ignores time zone #16973

Closed
MarcoGorelli opened this issue Oct 2, 2024 · 0 comments · Fixed by #16980
Closed

[BUG] astype ignores time zone #16973

MarcoGorelli opened this issue Oct 2, 2024 · 0 comments · Fixed by #16980
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@MarcoGorelli
Copy link

MarcoGorelli commented Oct 2, 2024

Describe the bug
A clear and concise description of what the bug is.

Steps/Code to reproduce bug

import cudf
from datetime import datetime, timezone

s = cudf.Series([datetime(2020, 1, 1, tzinfo=timezone.utc)])
s.astype('datetime64[ns, Asia/Kathmandu]')

outputs

0   2020-01-01
dtype: datetime64[ns]

Expected behavior

0   2020-01-01 05:45:00+05:45
dtype: datetime64[ns, Asia/Kathmandu]

like pandas does

Environment overview (please complete the following information)

  • Environment location: [Bare-metal, Docker, Cloud(specify cloud provider)]
  • Method of cuDF install: [conda, Docker, or from source]
    • 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
Spotted in Narwhals

@MarcoGorelli MarcoGorelli added the bug Something isn't working label Oct 2, 2024
@mroeschke mroeschke added the Python Affects Python cuDF API. label Oct 2, 2024
rapids-bot bot pushed a commit that referenced this issue Oct 3, 2024
closes #16973

Also matches astype from tz-naive to tz-aware type like pandas

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #16980
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

Successfully merging a pull request may close this issue.

2 participants