Closed isVoid closed 5 months 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 issue has been labeled inactive-90d
due to no recent activity in the past 90 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.
With some of the recent refactors of Index internals we now get a much clearer error here:
>>> cudf.from_pandas(pd.IntervalIndex([pd.Interval(1, 2), None, pd.Interval(3, 4)]))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nvme/0/vyasr/rapids/compose/etc/conda/cuda_11.5/envs/rapids/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/nvme/0/vyasr/rapids/cudf/python/cudf/cudf/core/index.py", line 1286, in __repr__
output = repr(self._clean_nulls_from_index().to_pandas())
File "/nvme/0/vyasr/rapids/cudf/python/cudf/cudf/core/index.py", line 1456, in _clean_nulls_from_index
self._values.astype("str").fillna(cudf._NA_REP), name=self.name
File "/nvme/0/vyasr/rapids/cudf/python/cudf/cudf/core/column/column.py", line 867, in astype
return self.as_string_column(dtype, **kwargs)
File "/nvme/0/vyasr/rapids/cudf/python/cudf/cudf/core/column/column.py", line 965, in as_string_column
raise NotImplementedError
NotImplementedError
What is missing is a string representation of IntervalColumn:
>>> x.astype("str")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nvme/0/vyasr/rapids/compose/etc/conda/cuda_11.5/envs/rapids/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/nvme/0/vyasr/rapids/cudf/python/cudf/cudf/core/index.py", line 1124, in astype
return _index_from_data(super().astype({self.name: dtype}, copy))
File "/nvme/0/vyasr/rapids/compose/etc/conda/cuda_11.5/envs/rapids/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/nvme/0/vyasr/rapids/cudf/python/cudf/cudf/core/frame.py", line 328, in astype
result[col_name] = col.astype(dt, copy=copy, **kwargs)
File "/nvme/0/vyasr/rapids/cudf/python/cudf/cudf/core/column/column.py", line 867, in astype
return self.as_string_column(dtype, **kwargs)
File "/nvme/0/vyasr/rapids/cudf/python/cudf/cudf/core/column/column.py", line 965, in as_string_column
raise NotImplementedError
NotImplementedError
or more clearly:
>>> x._column.as_string_column("str")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nvme/0/vyasr/rapids/cudf/python/cudf/cudf/core/column/column.py", line 965, in as_string_column
raise NotImplementedError
NotImplementedError
There are two options for solving this issue:
_clean_nulls_from_index
method of IntervalIndex
so that it does not rely on converting the underlying Column to a StringColumn
, or IntervalColumn.as_string_column
with proper handling of nulls.This was fixed in #13958
Describe the bug Today we can display interval index that contains no nulls
But if source data contains null, nothing is displayed
Expected behavior Pandas output:
Referring to our current behavior, I think it's ok to output
for now.
Environment overview (please complete the following information)
Environment details
Click here to see environment details