Skip to content

Fix an issue where casting null-array to object dtype will result in a failure - #13994

Merged
rapids-bot[bot] merged 4 commits into
NVIDIA:branch-23.10from
galipremsagar:13992
Aug 30, 2023
Merged

Fix an issue where casting null-array to object dtype will result in a failure#13994
rapids-bot[bot] merged 4 commits into
NVIDIA:branch-23.10from
galipremsagar:13992

Conversation

@galipremsagar

Copy link
Copy Markdown
Contributor

Description

closes #13992

This PR fixes the construction of an empty MultiIndex from pandas to cudf was causing an error in pandas-compatibility mode, null-array is one such case where it is okay to cast to any type because there is no data in it. Hence we pass str dtype to astype, whenever we encounter an object dtype.

Checklist

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

@galipremsagar galipremsagar added 3 - Ready for Review Ready for review by team Python Affects Python cuDF API. 4 - Needs cuDF (Python) Reviewer improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 29, 2023
@galipremsagar galipremsagar self-assigned this Aug 29, 2023
@galipremsagar
galipremsagar marked this pull request as ready for review August 29, 2023 16:29
@galipremsagar
galipremsagar requested a review from a team as a code owner August 29, 2023 16:29
@galipremsagar
galipremsagar requested review from isVoid and vyasr August 29, 2023 16:29
@copy-pr-bot

copy-pr-bot Bot commented Aug 29, 2023

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@galipremsagar

Copy link
Copy Markdown
Contributor Author

/ok to test

Comment thread python/cudf/cudf/core/column/column.py Outdated
@galipremsagar galipremsagar added improvement Improvement / enhancement to an existing function and removed improvement Improvement / enhancement to an existing function labels Aug 30, 2023
@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team 4 - Needs cuDF (Python) Reviewer labels Aug 30, 2023
@galipremsagar

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit f999e1c into NVIDIA:branch-23.10 Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to Merge Testing and reviews complete, ready to merge improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] cudf.from_pandas raises an error with empty MultiIndex in pandas-compatibility mode

3 participants