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

Misc Column cleanups #15682

Merged
merged 2 commits into from
May 8, 2024
Merged

Conversation

mroeschke
Copy link
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
@@ -820,7 +818,7 @@ def take(

# 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
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
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
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
Contributor

/merge

@rapids-bot rapids-bot bot merged commit 57e534a into rapidsai:branch-24.06 May 8, 2024
70 checks passed
@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
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants