-
Notifications
You must be signed in to change notification settings - Fork 859
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
[BUG] Series.__setitem__ that expands is not displayable #13860
Comments
|
@galipremsagar not sure where you got to, but maybe: diff --git a/python/cudf/cudf/core/series.py b/python/cudf/cudf/core/series.py
index 6ff0584538..931c67f63d 100644
--- a/python/cudf/cudf/core/series.py
+++ b/python/cudf/cudf/core/series.py
@@ -166,7 +166,7 @@ def _describe_categorical(obj, percentiles):
return data
-def _append_new_row_inplace(col: ColumnLike, value: ScalarLike):
+def _append_new_row(col: ColumnLike, value: ScalarLike, *, inplace):
"""Append a scalar `value` to the end of `col` inplace.
Cast to common type if possible
"""
@@ -174,7 +174,9 @@ def _append_new_row_inplace(col: ColumnLike, value: ScalarLike):
val_col = as_column(value, dtype=to_type)
old_col = col.astype(to_type)
- col._mimic_inplace(concat_columns([old_col, val_col]), inplace=True)
+ return col._mimic_inplace(
+ concat_columns([old_col, val_col]), inplace=inplace
+ )
class _SeriesIlocIndexer(_FrameIndexer):
@@ -274,8 +276,13 @@ class _SeriesLocIndexer(_FrameIndexer):
and not isinstance(self._frame.index, cudf.MultiIndex)
and is_scalar(value)
):
- _append_new_row_inplace(self._frame.index._values, key)
- _append_new_row_inplace(self._frame._column, value)
+ index = self._frame._index._values
+ col = self._frame._column
+ col = _append_new_row(col, value, inplace=False)
+ index = _append_new_row(index, key, inplace=False)
+ self._frame._mimic_inplace(
+ Series(col, index=index), inplace=True
+ )
return
else:
raise e |
Correct
|
Yup, that + we need to do some handling for |
This issue was resolved in 66fdbe7 |
Describe the bug
Series.setitem that expands is not displayable
Steps/Code to reproduce bug
EDIT: I notice something similar happens with
loc.__setitem__
andiloc.__seitem__
Expected behavior
This object repr should not be corrupted
Environment overview (please complete the following information)
docker pull
&docker run
commands usedEnvironment details
Please run and paste the output of the
cudf/print_env.sh
script here, to gather any other relevant environment detailsAdditional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: