Open isVoid opened 3 years ago
This issue has been labeled inactive-30d
due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d
if there is no activity in the next 60 days.
This still fails, but differently now. I end up with ValueError: Merge operands must have same number of join key columns
This still fails, but differently now. I end up with
ValueError: Merge operands must have same number of join key columns
I think the narrow issue is that Series._loc_to_iloc
doesn't have a carve-out for desugaring tuple keys, so they are treated like a list-like. This patch fixes the narrow issue:
diff --git a/python/cudf/cudf/core/series.py b/python/cudf/cudf/core/series.py
index c7bc97edd6..f55fd460e4 100644
--- a/python/cudf/cudf/core/series.py
+++ b/python/cudf/cudf/core/series.py
@@ -403,7 +403,9 @@ class _SeriesLocIndexer(_FrameIndexer):
arg = cudf.MultiIndex.from_pandas(arg)
return _indices_from_labels(self._frame, arg)
-
+ elif isinstance(self._frame.index, cudf.MultiIndex) and isinstance(arg, tuple):
+ arg = cudf.MultiIndex.from_tuples([arg])
+ return _indices_from_labels(self._frame, arg)
else:
arg = cudf.core.series.Series(cudf.core.column.as_column(arg))
if arg.dtype in (bool, np.bool_):
But doesn't address the broader issue that multiindex labels are not handled well: it breaks as soon as you say gs[[(1, 3), (2, 3)]]
, say.
Describe the bug When assigning to a row of a series with multiindex, cudf raises exception.
Steps/Code to reproduce bug
Expected behavior
Environment overview (please complete the following information)
Environment details
Click here to see environment details