[FEA] Support "mask" entries in `pylibcudf.Column.from_(cuda)_array_interface`
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
**Is your feature request related to a problem? Please describe.**
Currently cuDF classic allows parsing a `__cuda_array_interface__` with a `"mask"` entry:
```python
def _mask_from_cuda_array_interface_desc(obj, cai_mask) -> Buffer:
desc = cai_mask.__cuda_array_interface__
typestr = desc["typestr"]
typecode = typestr[1]
if typecode == "t":
mask_size = plc.null_mask.bitmask_allocation_size_bytes(
desc["shape"][0]
)
return as_buffer(data=desc["data"][0], size=mask_size, owner=obj)
elif typecode == "b":
return as_column(cai_mask).as_mask()
else:
raise NotImplementedError(f"Cannot infer mask from typestr {typestr}")
```
**Describe the solution you'd like**
It would be nice if this could be integrated directly into pylibcudf to avoid a current workaround where this mask is "popped" from the original interface object and processed separately.
This ideally should be extended to `__array_interface__` as well.
Contributor guide
Assessment
This issue has not been assessed yet.