Skip to content

Rename get_dtype_of_same_kind to get_dtype_of_same_variant and move to converters.py - #21376

Closed
mroeschke wants to merge 6 commits into
NVIDIA:mainfrom
mroeschke:ref/cudf/converters
Closed

Rename get_dtype_of_same_kind to get_dtype_of_same_variant and move to converters.py#21376
mroeschke wants to merge 6 commits into
NVIDIA:mainfrom
mroeschke:ref/cudf/converters

Conversation

@mroeschke

Copy link
Copy Markdown
Contributor

Description

As we're working toward enabling native support for pandas extension types, #21229, we'll need to make heavy use of get_dtype_of_same_kind to return an extension type if the input has an extension type.

Similar to #21281, I think it's good opportunity to move this function to it's own dtype/converters.py file, rename it to get_dtype_of_same_variant, and finish out it's implementation by using functools.singledispatch to define all the conversions between dtype variants.

Ops-Bot-Merge-Barrier: true

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 self-assigned this Feb 6, 2026
@mroeschke
mroeschke requested a review from a team as a code owner February 6, 2026 22:12
@mroeschke mroeschke added Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function labels Feb 6, 2026
@mroeschke mroeschke added the non-breaking Non-breaking change label Feb 6, 2026
@GPUtester GPUtester moved this to In Progress in cuDF Python Feb 6, 2026
@mroeschke

Copy link
Copy Markdown
Contributor Author

I think the PR over-zealously assumes that an API will return the same variant as itself. But for example a pd.StringDtype may return a int64 and not an pd.Int64Dtype, so I may need to rethink this

@mroeschke mroeschke closed this Feb 7, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python Feb 7, 2026
@mroeschke
mroeschke deleted the ref/cudf/converters branch May 7, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants