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

Enable pd.Timestamp objects to be picklable when cudf.pandas is active #14474

Merged
merged 6 commits into from
Nov 27, 2023

Conversation

shwina
Copy link
Contributor

@shwina shwina commented Nov 22, 2023

Closes #14471.

This PR makes Timestamp objects picklable by registering a custom reducer for pd.Timestamp objects when cudf.pandas is active.

shwina and others added 4 commits November 17, 2023 14:27
…14388)

Closes rapidsai#14384. `x.startswith(y)` is not a good enough check for if `x` is a subdirectory of `y`. It causes `pandasai` to be reported as a sub-package of `pandas`.

Authors:
  - Ashwin Srinath (https://github.com/shwina)

Approvers:
  - https://github.com/brandon-b-miller

URL: rapidsai#14388
@github-actions github-actions bot added the Python Affects Python cuDF API. label Nov 22, 2023
@shwina shwina added non-breaking Non-breaking change bug Something isn't working labels Nov 22, 2023
@shwina shwina marked this pull request as ready for review November 22, 2023 19:08
@shwina shwina requested a review from a team as a code owner November 22, 2023 19:08
return _unpickle_timestamp, (pickled_args,)


def _unpickle_timedelta(pickled_args):
Copy link
Contributor

Choose a reason for hiding this comment

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

How is _unpickle_timedelta different from _unpickle_timestamp? Similarly for _reduce_*. They look identical to me. Do we need this duplication or can we simplify things?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, this looks like it can be deduplicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right you are -- they are the same function and I've deduplicated

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

One question about duplication -- otherwise LGTM. Waiting to approve until we can discuss that question.

Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

Approving assuming Bradley's question about duplication is addressed.

return _unpickle_timestamp, (pickled_args,)


def _unpickle_timedelta(pickled_args):
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, this looks like it can be deduplicated.

@shwina
Copy link
Contributor Author

shwina commented Nov 27, 2023

/merge

@rapids-bot rapids-bot bot merged commit c8d481e into rapidsai:branch-24.02 Nov 27, 2023
66 of 67 checks passed
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
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] pd.Timestamp objects are not picklable when cudf.pandas is active
3 participants