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

Use public cudf APIs where possible #5795

Merged
merged 4 commits into from
Mar 11, 2024

Conversation

mroeschke
Copy link
Contributor

Avoiding core imports as they tend to be "private"

@mroeschke mroeschke requested a review from a team as a code owner March 6, 2024 01:19
@github-actions github-actions bot added the Cython / Python Cython or Python issue label Mar 6, 2024
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Approving with one small suggestion.

Comment on lines 777 to 780
if constructor == cudf.DataFrame:
original_type = Frame

assert isinstance(clf.predict_proba(X), original_type)
assert isinstance(clf.predict(X), original_type)
assert isinstance(clf.predict(X), cudf.Series)
else:
assert isinstance(clf.predict(X), type(X))
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's do this instead. It reduces some duplication of clf.predict.

expected_type = cudf.Series if constructor == cudf.DataFrame else type(X)
assert isinstance(clf.predict(X), expected_type)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Addressed

@dantegd dantegd added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Mar 11, 2024
@dantegd
Copy link
Member

dantegd commented Mar 11, 2024

/merge

@rapids-bot rapids-bot bot merged commit 0b181dd into rapidsai:branch-24.04 Mar 11, 2024
59 checks passed
@mroeschke mroeschke deleted the imports/cudf/public branch March 11, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants