-
Notifications
You must be signed in to change notification settings - Fork 915
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] nested types is_monotonic* exception in cudf #7653
Comments
What's weird is if I do: struct_series.is_mon<TAB> I get a C++ exception:
But if I actually run the method, I get a nice Python exception: struct_series.is_monotonic_increasing
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
<ipython-input-5-ab40890a5f5e> in <module>
----> 1 struct_series.is_monotonic_decreasing
~/cudf/python/cudf/cudf/core/series.py in is_monotonic_decreasing(self)
6241 out : bool
6242 """
-> 6243 return self._column.is_monotonic_decreasing
6244
6245 @property
~/cudf/python/cudf/cudf/core/column/column.py in is_monotonic_decreasing(self)
967 else:
968 self._is_monotonic_decreasing = self.as_frame()._is_sorted(
--> 969 ascending=[False], null_position=None
970 )
971 return self._is_monotonic_decreasing
~/cudf/python/cudf/cudf/core/frame.py in _is_sorted(self, ascending, null_position)
3493 """
3494 return libcudf.sort.is_sorted(
-> 3495 self, ascending=ascending, null_position=null_position
3496 )
3497
~/cudf/python/cudf/cudf/_lib/sort.pyx in cudf._lib.sort.is_sorted()
102 cdef table_view source_table_view = source_table.data_view()
103 with nogil:
--> 104 c_result = cpp_is_sorted(
105 source_table_view,
106 column_order,
MemoryError: std::bad_alloc: CUDA error at: ../include/rmm/mr/device/cuda_memory_resource.hpp:69: cudaErrorAssert device-side assert triggered |
MRE: >>> struct_series = cudf.Series([ {"Int": -1}, {"Int": 1}, {"Int": None} ])
>>> hasattr(struct_series, "is_monotonic") Output: ../../../../include/cudf/table/row_operators.cuh:294: cudf::weak_ordering cudf::element_relational_comparator<has_nulls>::operator()(signed int, signed int) [with Element = cudf::struct_view; void *<anonymous
> = (void *)nullptr; __nv_bool has_nulls = false]: block: [0,0,0], thread: [0,0,0] Assertion `false && "Attempted to compare elements of uncomparable types."` failed.
../../../../include/cudf/table/row_operators.cuh:294: cudf::weak_ordering cudf::element_relational_comparator<has_nulls>::operator()(signed int, signed int) [with Element = cudf::struct_view; void *<anonymous
> = (void *)nullptr; __nv_bool has_nulls = false]: block: [0,0,0], thread: [1,0,0] Assertion `false && "Attempted to compare elements of uncomparable types."` failed.
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-3-64c6bc5cafb5> in <module>
----> 1 hasattr(struct_series, "is_monotonic")
~/cudf/python/cudf/cudf/core/series.py in is_monotonic(self)
6219 out : bool
6220 """
-> 6221 return self._column.is_monotonic_increasing
6222
6223 @property
~/cudf/python/cudf/cudf/core/column/column.py in is_monotonic_increasing(self)
956 else:
957 self._is_monotonic_increasing = self.as_frame()._is_sorted(
--> 958 ascending=None, null_position=None
959 )
960 return self._is_monotonic_increasing
~/cudf/python/cudf/cudf/core/frame.py in _is_sorted(self, ascending, null_position)
3493 """
3494 return libcudf.sort.is_sorted(
-> 3495 self, ascending=ascending, null_position=null_position
3496 )
3497
~/cudf/python/cudf/cudf/_lib/sort.pyx in cudf._lib.sort.is_sorted()
102 cdef table_view source_table_view = source_table.data_view()
103 with nogil:
--> 104 c_result = cpp_is_sorted(
105 source_table_view,
106 column_order,
RuntimeError: reduce failed to synchronize: cudaErrorAssert: device-side assert triggered |
In general, Python users shouldn't "see" C++ exceptions directly. Our Cython bindings are marked with In this case, it looks like the C++ uses Thus, we see the raw output of As for the behaviour of tab completion, I believe that tab completion evaluates any properties, but swallows exceptions they may raise: In [4]: class Foo:
...: @property
...: def prop(self):
...: print("hello")
...: raise ZeroDivisionError()
...:
In [5]: x = Foo()
In [6]: x.prop<TAB> # "hello" printed, but no exception raised |
This issue has been labeled |
Resolved by #7583 |
Describe the bug
C++ exceptions are thrown during autocomplete in python of nested type columns with more than one element (struct, list).
Steps/Code to reproduce bug
Expected behavior
No C++ exceptions should be thrown during autocomplete.
Environment overview (please complete the following information)
Environment details
Click here to see environment details
Additional context
#7422 (comment)
The text was updated successfully, but these errors were encountered: