Skip to content

Misc Column cleanups - #15682

Merged
rapids-bot[bot] merged 2 commits into
NVIDIA:branch-24.06from
mroeschke:cln/columns/misc
May 8, 2024
Merged

Misc Column cleanups#15682
rapids-bot[bot] merged 2 commits into
NVIDIA:branch-24.06from
mroeschke:cln/columns/misc

Conversation

@mroeschke

Copy link
Copy Markdown
Contributor

Description

  • Some typing
  • Moved a single use helper function inline
  • Some dtype checking simplification

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 Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels May 7, 2024
@mroeschke
mroeschke requested a review from a team as a code owner May 7, 2024 01:47
# TODO: For performance, the check and conversion of gather map should
# be done by the caller. This check will be removed in future release.
if not is_integer_dtype(indices.dtype):
if indices.dtype.kind not in {"u", "i"}:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wouldn't this be a problem incase of StructColumn and DecimalColumn's? Those types will lack .kind attribute.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They have a default of "O" (object type), so that would work here since we want to exclude those

In [1]: import cudf

In [2]: cudf.Decimal128Dtype(2)
Out[2]: Decimal128Dtype(precision=2, scale=0)

In [3]: cudf.Decimal128Dtype(2).kind
Out[3]: 'O'

In [4]: cudf.StructDtype({"a": "int64"}).kind
Out[4]: 'O'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay, as long as that's covered we are good.

@galipremsagar

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit 57e534a into NVIDIA:branch-24.06 May 8, 2024
@mroeschke
mroeschke deleted the cln/columns/misc branch May 8, 2024 23:38
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