Skip to content
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

unwrap_pyoptcol is missing except keyword that causes exceptions ignored, fixes function bug #719

Merged
merged 1 commit into from
Oct 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions python/cuspatial/cuspatial/_lib/utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ from cudf._lib.cpp.column.column_view cimport column_view
from cuspatial._lib.cpp.optional cimport nullopt, optional


cdef optional[column_view] unwrap_pyoptcol(pyoptcol):
cdef optional[column_view] unwrap_pyoptcol(pyoptcol) except *:
# Unwrap python optional Column arg to c optional[column_view]
cdef Column pycol
cdef optional[column_view] c_opt = nullopt
cdef optional[column_view] c_opt
if isinstance(pyoptcol, Column):
pycol = pyoptcol
c_opt = pycol.view()
elif pyoptcol is None:
c_opt = nullopt
else:
raise ValueError("pyoptcol must be a Column or None")
raise ValueError("pyoptcol must be either Column or None.")
return c_opt