[BUG] `pylibcudf.Column.from_iterable_of_py(<nested_list>, dtype=plc.TypeId.LIST)` erroneously raises
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in pylibcudf/column.pyx at Column.from_iterable_of_py and inspect the related DataType handling in pylibcudf/types.pyx. Reproduce the nested-list example with an explicit LIST dtype, then verify that it follows the same inferred inner-type behavior as the call without dtype and no longer raises NotImplementedError.
Written by the indexing model from the issue text.
Description
Steps/Code to reproduce bug
In [1]: import pylibcudf as plc
In [2]: plc.Column.from_iterable_of_py([[1, 2, 3]]) # works
Out[2]: <pylibcudf.column.Column at 0x77d150dcbd60>
In [3]: plc.Column.from_iterable_of_py([[1, 2, 3]], dtype=plc.DataType(plc.TypeId.LIST))
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
File ~/cudf/python/pylibcudf/pylibcudf/types.pyx:151, in pylibcudf.types.DataType._python_typecode.__get__()
KeyError: <type_id.LIST: 24>
During handling of the above exception, another exception occurred:
NotImplementedError Traceback (most recent call last)
Cell In[3], line 1
----> 1 plc.Column.from_iterable_of_py([[1, 2, 3]], dtype=plc.DataType(plc.TypeId.LIST))
File ~/cudf/python/pylibcudf/pylibcudf/column.pyx:1238, in pylibcudf.column.Column.from_iterable_of_py()
File ~/cudf/python/pylibcudf/pylibcudf/types.pyx:153, in pylibcudf.types.DataType._python_typecode.__get__()
NotImplementedError: No Python typecode for DataType <type_id.LIST: 24>
I believe here we should still be "flattening" and inferring the inner type in the else clause if a plc.DataType(plc.TypeId.LIST) is passed
if dtype is None:
depth, py_dtype = _infer_list_depth_and_dtype(obj)
dtype = DataType.from_py(py_dtype)
else:
depth, _ = _infer_list_depth_and_dtype(obj)
Expected behavior
Same as Out[2]
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 251
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cudf
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
-
bug libcudf
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
? - Needs Triage doc
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·