Open charlesbluca opened 3 years ago
@charlesbluca is this affecting work related to pack/unpack, or just discovered during testing?
Yes, this bug means that attempts to pack dataframes with a DatetimeIndex
will error.
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.
Bumping with the new traceback I'm getting for this:
RuntimeError Traceback (most recent call last)
Input In [1], in <cell line: 5>()
2 import cudf
4 df = cudf.from_pandas(pd._testing.makeTimeDataFrame()) # len(df.index) == 30
----> 5 df.index.equals(cudf.RangeIndex(start=0, stop=30, step=1))
File ~/compose/etc/conda/cuda_11.5/envs/rapids/lib/python3.9/contextlib.py:79, in ContextDecorator.__call__.<locals>.inner(*args, **kwds)
76 @wraps(func)
77 def inner(*args, **kwds):
78 with self._recreate_cm():
---> 79 return func(*args, **kwds)
File ~/cudf/python/cudf/cudf/core/index.py:971, in GenericIndex.equals(self, other, **kwargs)
968 check_dtypes = True
970 try:
--> 971 return self._column.equals(
972 other._column, check_dtypes=check_dtypes
973 )
974 except TypeError:
975 return False
File ~/cudf/python/cudf/cudf/core/column/column.py:188, in ColumnBase.equals(self, other, check_dtypes)
186 if check_dtypes and (self.dtype != other.dtype):
187 return False
--> 188 ret = self._binaryop(other, "NULL_EQUALS")
189 if ret is NotImplemented:
190 raise TypeError(f"Cannot compare equality with {type(other)}")
File ~/cudf/python/cudf/cudf/core/column/datetime.py:448, in DatetimeColumn._binaryop(self, other, op)
445 if out_dtype is None:
446 return NotImplemented
--> 448 return libcudf.binaryop.binaryop(lhs, rhs, op, out_dtype)
File ~/cudf/python/cudf/cudf/_lib/binaryop.pyx:197, in cudf._lib.binaryop.binaryop()
File ~/cudf/python/cudf/cudf/_lib/binaryop.pyx:109, in cudf._lib.binaryop.binaryop_v_v()
RuntimeError: cuDF failure at: /datasets/charlesb/dev/rapids/cudf/cpp/src/binaryop/binaryop.cpp:202: Unsupported operator for these types
Looking through the code for DatetimeColumn._binaryop
, seems like maybe we would want some handling here to ensure that the columns can be compared properly before passing off to libcudf? I assume adding a condition here
Should do the trick, though I'm not sure if we're able to compute NULL_EQUALS
with columns of a non-datetime dtype.
Describe the bug Attempting to compare a
DatetimeIndex
andRangeIndex
usingIndex.equals()
causes aRuntimeError
, seemingly failing oncudf._lib.cpp.binaryop.binary_operation()
.Steps/Code to reproduce bug
Results in:
Subsequent attempts result in the same traceback, but with a different
RuntimeError
:Expected behavior I would expect a boolean
False
, stating that the two indices are not equal.Environment overview (please complete the following information)
Environment details
Click here to see environment details
Additional context I ran into this issue testing the pack/unpack API on
test_serialize.py
because of a specific index equality check incudf._lib.copying._CPackedColumns.from_py_table()
:https://github.com/rapidsai/cudf/blob/53b3c1696ba7e545e0f67566415259362ace9276/python/cudf/cudf/_lib/copying.pyx#L798-L800