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

Add _from_column_like_self factory #10022

Merged

Conversation

isVoid
Copy link
Contributor

@isVoid isVoid commented Jan 11, 2022

Follow up to #9558

On a return trip from libcudf, it is a common pattern for cudf frame to apply its own metadata to the columns. This PR generalizes this procedure as a new factory function _from_colums_like_self

@github-actions github-actions bot added the Python Affects Python cuDF API. label Jan 11, 2022
@isVoid isVoid added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jan 11, 2022
@codecov
Copy link

codecov bot commented Jan 12, 2022

Codecov Report

Merging #10022 (89d5087) into branch-22.02 (967a333) will decrease coverage by 0.11%.
The diff coverage is n/a.

❗ Current head 89d5087 differs from pull request most recent head d63948a. Consider uploading reports for the commit d63948a to get more accurate results
Impacted file tree graph

@@               Coverage Diff                @@
##           branch-22.02   #10022      +/-   ##
================================================
- Coverage         10.49%   10.37%   -0.12%     
================================================
  Files               119      119              
  Lines             20305    20158     -147     
================================================
- Hits               2130     2091      -39     
+ Misses            18175    18067     -108     
Impacted Files Coverage Δ
python/custreamz/custreamz/tests/conftest.py 71.42% <0.00%> (-7.15%) ⬇️
python/custreamz/custreamz/tests/test_kafka.py 38.46% <0.00%> (-4.40%) ⬇️
...ython/custreamz/custreamz/tests/test_dataframes.py 96.97% <0.00%> (-2.42%) ⬇️
python/custreamz/custreamz/kafka.py 29.16% <0.00%> (-0.63%) ⬇️
python/dask_cudf/dask_cudf/backends.py 82.53% <0.00%> (-0.61%) ⬇️
python/dask_cudf/dask_cudf/core.py 70.68% <0.00%> (-0.34%) ⬇️
python/dask_cudf/dask_cudf/accessors.py 92.00% <0.00%> (-0.31%) ⬇️
python/dask_cudf/dask_cudf/sorting.py 92.66% <0.00%> (-0.25%) ⬇️
python/dask_cudf/dask_cudf/io/tests/test_s3.py 95.77% <0.00%> (-0.18%) ⬇️
python/dask_cudf/dask_cudf/io/parquet.py 93.46% <0.00%> (-0.17%) ⬇️
... and 65 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8fd7dd2...d63948a. Read the comment docs.

@isVoid isVoid marked this pull request as ready for review January 19, 2022 19:14
@isVoid isVoid requested a review from a team as a code owner January 19, 2022 19:14
Copy link
Contributor

@rgsl888prabhu rgsl888prabhu left a comment

Choose a reason for hiding this comment

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

A small suggestion

python/cudf/cudf/core/frame.py Show resolved Hide resolved
Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

I like keeping this PR's scope narrow for now since it's targeting 22.02. We'll need to make a follow-up PR that looks through all of the classes inheriting from Frame and substitutes this new factory everywhere that it could be used. I think there are a lot more places. Additionally, we'll probably find some places where _from_columns is being called without a subsequent call to _apply_type_metadata, so we should be able to fix some bugs by doing that scan.

python/cudf/cudf/core/frame.py Show resolved Hide resolved
python/cudf/cudf/core/frame.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/frame.py Show resolved Hide resolved
python/cudf/cudf/core/_base_index.py Show resolved Hide resolved
@isVoid isVoid requested a review from vyasr January 19, 2022 20:42
@isVoid
Copy link
Contributor Author

isVoid commented Jan 20, 2022

rerun tests

2 similar comments
@vyasr
Copy link
Contributor

vyasr commented Jan 20, 2022

rerun tests

@galipremsagar
Copy link
Contributor

rerun tests

@galipremsagar galipremsagar added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Jan 20, 2022
@isVoid
Copy link
Contributor Author

isVoid commented Jan 20, 2022

rerun tests

@shwina
Copy link
Contributor

shwina commented Jan 20, 2022

@gpucibot merge

1 similar comment
@galipremsagar
Copy link
Contributor

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 2bd7320 into rapidsai:branch-22.02 Jan 20, 2022
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 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.

6 participants