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

Support IntervalDtype in cudf.from_pandas #16014

Merged

Conversation

mroeschke
Copy link
Contributor

Description

Noticed while running the pandas test suite against cudf.pandas

Checklist

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

@mroeschke mroeschke added bug Something isn't working Python Affects Python cuDF API. non-breaking Non-breaking change labels Jun 12, 2024
@mroeschke mroeschke requested a review from a team as a code owner June 12, 2024 22:39
Copy link
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

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

non-blocking nit

@@ -8072,6 +8072,8 @@ def from_pandas(obj, nan_as_null=no_default):
return cudf.Index.from_pandas(obj, nan_as_null=nan_as_null)
elif isinstance(obj, pd.CategoricalDtype):
return cudf.CategoricalDtype.from_pandas(obj)
elif isinstance(obj, pd.IntervalDtype):
return cudf.IntervalDtype.from_pandas(obj)
else:
raise TypeError(
"from_pandas only accepts Pandas Dataframes, Series, "
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this error string is increasingly out of date (it doesn't mention categoricaldtype and now intervaldtype). Should we reword the be less specific?

f"from_pandas unsupported for object of type {type(obj)}"

perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing. Changed to this

@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 31d909b into rapidsai:branch-24.08 Jun 13, 2024
75 checks passed
@mroeschke mroeschke deleted the bug/from_pandas/intervaldtype branch June 13, 2024 23:27
This pull request was closed.
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
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants