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

Fix copying dtype metadata after calling libcudf functions #7271

Merged

Conversation

shwina
Copy link
Contributor

@shwina shwina commented Feb 1, 2021

Fixes #7249

Copies dtype metadata after calling ColumnBase.copy(). Moves logic for copying dtype metadata after calling libcudf functions from Frame to ColumnBase.

@shwina shwina added bug Something isn't working non-breaking Non-breaking change labels Feb 1, 2021
@shwina shwina marked this pull request as ready for review February 1, 2021 23:06
@shwina shwina requested a review from a team as a code owner February 1, 2021 23:06

if include_index and self._index is not None:
assert other._index is not None
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we throw with an error message here instead of assert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't meant to ever propagate up to the user. The assert is used here to tell MyPy that other._index is of type Index (and not Optional[Index]):

https://mypy.readthedocs.io/en/stable/kinds_of_types.html#optional-types-and-the-none-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.

cc: @kkraus14 for visiblity as we were just discussing this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can do better here by checking if other is a DataFrameOrSeries instead. Looking into it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just used a conditional instead of using an assertion here. Along the way, realized we could simplify this function further.

@kkraus14 kkraus14 added the Python Affects Python cuDF API. label Feb 2, 2021
@kkraus14 kkraus14 added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Feb 2, 2021
@galipremsagar
Copy link
Contributor

rerun tests

1 similar comment
@shwina
Copy link
Contributor Author

shwina commented Feb 3, 2021

rerun tests

@kkraus14
Copy link
Collaborator

kkraus14 commented Feb 4, 2021

@gpucibot merge

@codecov
Copy link

codecov bot commented Feb 4, 2021

Codecov Report

Merging #7271 (6572e4b) into branch-0.18 (8860baf) will increase coverage by 0.12%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           branch-0.18    #7271      +/-   ##
===============================================
+ Coverage        82.09%   82.21%   +0.12%     
===============================================
  Files               97      100       +3     
  Lines            16474    16955     +481     
===============================================
+ Hits             13524    13940     +416     
- Misses            2950     3015      +65     
Impacted Files Coverage Δ
python/cudf/cudf/__init__.py 100.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/avro.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/csv.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/fuzzer.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/io.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/json.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/main.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/orc.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/parquet.py 0.00% <ø> (ø)
python/cudf/cudf/_fuzz_testing/utils.py 0.00% <ø> (ø)
... and 82 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 54cddb1...9ef4c99. Read the comment docs.

@rapids-bot rapids-bot bot merged commit 253dfdf into rapidsai:branch-0.18 Feb 4, 2021
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 bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Selecting struct column drops field names
3 participants