-
Notifications
You must be signed in to change notification settings - Fork 918
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
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): |
) | ||
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
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.
I think that's ok if it's going soon anyway
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.
I agree, I'm OK leaving this for now in anticipation of the code being removed altogether soon.
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.
…into cln/cudf/types/2
Co-authored-by: Lawrence Mitchell <[email protected]>
/merge |
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.
Ack I though I submitted this review already.
One suggestion for improvement, otherwise LGTM.
cdef dtype_from_lists_column_view(column_view cv) | ||
cdef dtype_from_column_view(column_view cv) |
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.
Can we remove these declarations? AFAICT these functions aren't needed outside of column.pyx, and you shouldn't have to declare functions in a pxd file if they aren't going to be cimported into other modules (you do have to declare cdef classes though).
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.
dtype_from_column_view
is actually cimported in Morpheus currently nv-morpheus/Morpheus#2097 but ah yes I suppose dtype_from_lists_column_view
didn't need to be defined here
Description
Contributes to #17317
cudf/utils/dtypes.py
cudf/_libs/column.pyx
Checklist