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

cudf.pandas: Series dt accessor is CombinedDatetimelikeProperties #15523

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

wence-
Copy link
Contributor

@wence- wence- commented Apr 12, 2024

Description

On the pandas Series type (not an instance) the dt attribute returns a CombinedDatetimelikeProperties object, which advertises the attributes of all possible datetime like dtypes. Previously we were proxying this with a DatatimeProperties object, which doesn't advertise as many properties. To allow wrapping libraries like dask that introspect the object to work correctly, advertise like pandas on the type. The instance still produces an object of the correct type due to dynamic lookup and/or metaclass magic in cudf.pandas and pandas respectively.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

On the pandas Series type (not an instance) the dt attribute returns a
CombinedDatetimelikeProperties object, which advertises the attributes
of all possible datetime like dtypes. Previously we were proxying this
with a DatatimeProperties object, which doesn't advertise as many
properties. To allow wrapping libraries like dask that introspect the
object to work correctly, advertise like pandas on the type. The
instance still produces an object of the correct type due to dynamic
lookup and/or metaclass magic in cudf.pandas and pandas respectively.

- Closes rapidsai#15522
@wence- wence- requested a review from a team as a code owner April 12, 2024 13:32
@github-actions github-actions bot added the Python Affects Python cuDF API. label Apr 12, 2024
@wence- wence- added bug Something isn't working non-breaking Non-breaking change labels Apr 12, 2024
Copy link
Member

@pentschev pentschev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @wence- !

@galipremsagar
Copy link
Contributor

/merge

@rapids-bot rapids-bot bot merged commit 2e00cb1 into rapidsai:branch-24.06 Apr 12, 2024
71 checks passed
@wence- wence- deleted the wence/fix/15522 branch April 15, 2024 16:25
@isVoid
Copy link
Contributor

isVoid commented Apr 24, 2024

Any chance this fix can be back ported to 24.04? Several tests are failing for cuml / cugraph + cudf.pandas integration on 24.04.

https://github.com/rapidsai/cudf-pandas-integration/actions/runs/8795887860/job/24137747663
https://github.com/rapidsai/cudf-pandas-integration/actions/runs/8770878281/job/24067951228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] AttributeError: type object 'DatetimeProperties' has no attribute 'components'
4 participants