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] DatetimeArray is not writable in cudf.pandas #17743

Open
galipremsagar opened this issue Jan 15, 2025 · 0 comments
Open

[BUG] DatetimeArray is not writable in cudf.pandas #17743

galipremsagar opened this issue Jan 15, 2025 · 0 comments
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@galipremsagar
Copy link
Contributor

Describe the bug
When a DatetimeArray is created in cudf.pandas, it appears to be that the internal ndarray is not writable.

Steps/Code to reproduce bug

import pandas as pd
i = pd.date_range("2016-01-01 01:01:00", periods=5)
print(i)
print(i._data)
print(i._data._ndarray.flags)

output:

(cudfdev) pgali@dgx19:/datasets/pgali/cudf$ python y1.py 
DatetimeIndex(['2016-01-01 01:01:00', '2016-01-02 01:01:00',
               '2016-01-03 01:01:00', '2016-01-04 01:01:00',
               '2016-01-05 01:01:00'],
              dtype='datetime64[ns]', freq='D')
<DatetimeArray>
['2016-01-01 01:01:00', '2016-01-02 01:01:00', '2016-01-03 01:01:00',
 '2016-01-04 01:01:00', '2016-01-05 01:01:00']
Length: 5, dtype: datetime64[ns]
  C_CONTIGUOUS : True
  F_CONTIGUOUS : True
  OWNDATA : False
  WRITEABLE : True
  ALIGNED : True
  WRITEBACKIFCOPY : False

(cudfdev) pgali@dgx19:/datasets/pgali/cudf$ python -m cudf.pandas y1.py 
DatetimeIndex(['2016-01-01 01:01:00', '2016-01-02 01:01:00',
               '2016-01-03 01:01:00', '2016-01-04 01:01:00',
               '2016-01-05 01:01:00'],
              dtype='datetime64[ns]', freq='D')
<DatetimeArray>
['2016-01-01 01:01:00', '2016-01-02 01:01:00', '2016-01-03 01:01:00',
 '2016-01-04 01:01:00', '2016-01-05 01:01:00']
Length: 5, dtype: datetime64[ns]
  C_CONTIGUOUS : True
  F_CONTIGUOUS : True
  OWNDATA : False
  WRITEABLE : False # Expected True
  ALIGNED : True
  WRITEBACKIFCOPY : False
@galipremsagar galipremsagar added bug Something isn't working Python Affects Python cuDF API. labels Jan 15, 2025
@galipremsagar galipremsagar self-assigned this Jan 15, 2025
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
Status: Todo
Development

No branches or pull requests

1 participant