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

Fix an issue with IntervalIndex.repr when null values are present #13958

Merged
merged 4 commits into from
Aug 25, 2023

Conversation

galipremsagar
Copy link
Contributor

Description

closes #13954

This PR fixes an issue with IntervalIndex.repr, where there was a silent failure because of no dedicated _clean_nulls_from_index and the GenericIndex._clean_nulls_from_index wouldn't work because a type-cast to str isn't implemented.

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 requested a review from a team as a code owner August 25, 2023 00:51
@galipremsagar galipremsagar self-assigned this Aug 25, 2023
@galipremsagar galipremsagar requested review from shwina and bdice August 25, 2023 00:51
@galipremsagar galipremsagar changed the title Fix an issue with IntervalIndex.repr when there are null values Fix an issue with IntervalIndex.repr when null values are present Aug 25, 2023
@github-actions github-actions bot added the Python Affects Python cuDF API. label Aug 25, 2023
@galipremsagar galipremsagar added bug Something isn't working non-breaking Non-breaking change 3 - Ready for Review Ready for review by team 4 - Needs cuDF (Python) Reviewer labels Aug 25, 2023
return f"interval[{self.subtype}, {self.closed}]"

def __str__(self) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noting that pandas' IntervalDtype.__str__ considers a few more cases, but I am not sure if cudf has all these cases implemented

https://github.com/pandas-dev/pandas/blob/6d021ac5b51c879eb6e4409711f840ea170e5a1f/pandas/core/dtypes/dtypes.py#L1315-L1321

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In case of cudf, looks like subtype is mandatory and optional for pandas.

@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 25, 2023
@galipremsagar
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit ec1e73f into rapidsai:branch-23.10 Aug 25, 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 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] repr failing silently when IntervalIndex with null values is rendered
2 participants