-
Notifications
You must be signed in to change notification settings - Fork 908
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
Fix copying dtype metadata after calling libcudf functions #7271
Conversation
…ix-dtype-metadata-preservation
python/cudf/cudf/core/frame.py
Outdated
|
||
if include_index and self._index is not None: | ||
assert other._index is not None |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
rerun tests |
1 similar comment
rerun tests |
…ix-dtype-metadata-preservation
@gpucibot merge |
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
Fixes #7249
Copies dtype metadata after calling
ColumnBase.copy()
. Moves logic for copying dtype metadata after calling libcudf functions fromFrame
toColumnBase
.