-
Notifications
You must be signed in to change notification settings - Fork 917
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
Remove cudf._libs.types.pyx #17665
base: branch-25.02
Are you sure you want to change the base?
Remove cudf._libs.types.pyx #17665
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits
python/cudf/cudf/_lib/column.pyx
Outdated
@@ -64,6 +62,80 @@ cdef get_element(column_view col_view, size_type index): | |||
) | |||
|
|||
|
|||
def dtype_from_pylibcudf_column(col): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def dtype_from_pylibcudf_column(col): | |
def dtype_from_pylibcudf_column(Column col not None): |
@@ -424,7 +496,7 @@ cdef class Column: | |||
col = self | |||
data_dtype = col.dtype | |||
|
|||
cdef plc_DataType dtype = dtype_to_pylibcudf_type(data_dtype) | |||
cdef plc_DataType dtype = <plc_DataType>dtype_to_pylibcudf_type(data_dtype) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cdef plc_DataType dtype = <plc_DataType>dtype_to_pylibcudf_type(data_dtype) | |
cdef plc_DataType dtype = <plc_DataType?>dtype_to_pylibcudf_type(data_dtype) |
I think we want this to be a fallible cast.
) | ||
elif cdtype_id == plc.TypeID.STRUCT: | ||
self._dtype = StructDtype.from_arrow( | ||
plc.interop.to_arrow(self.c_value).type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This now necessitates a device to host copy and synchronisation just to get the type (which is a host-side thing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was hoping that this would be temporarily OK as I'm aiming remove DeviceScalar
(along with this code) by the next release cc @vyasr
plc.interop.to_arrow(self.c_value).type | ||
) | ||
elif cdtype_id == plc.TypeID.LIST: | ||
self._dtype = ListDtype.from_arrow(plc.interop.to_arrow(self.c_value).type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: same issue here as with structs.
Description
Contributes to #17317
cudf/utils/dtypes.py
cudf/_libs/column.pyx
Checklist