rapidsai/cudf

[BUG] `cudf.read_text` throws an exception when reading a host buffer

Geschlossen

#13.734 geöffnet am 22.07.2023

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (735 Forks)batch import
0 - BacklogPythonbugcuIOgood first issue

Repository-Metriken

Stars
 (6.000 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 17T 21h) (230 gemergte PRs in 30 T)

Beschreibung

Describe the bug cudf.read_text throws an exception when reading a host buffer, unlike the CSV, Parquet, ORC and JSON readers. Hopefully it is straightforward to enable cudf.read_text to read from host buffers.

Steps/Code to reproduce bug Here is a small code snippet that shows the exception:

from io import BytesIO
import cudf

df = cudf.DataFrame({'a':['aaaa','bbbb']})

buf = BytesIO()
df.to_csv(buf, index=False)
df2 = cudf.read_csv(buf) # this is ok
print(df2)

buf = BytesIO()
df.to_csv(buf, index=False)
df2 = cudf.read_text(buf, delimiter='\n') # this crashes
print(df2)

Expected behavior I expect that read_text would support host buffers correctly in the python layer. "multibyte_split" works fine with HOST_BUFFER data source in the libcudf benchmarks.

Environment overview (please complete the following information) nightly docker image from 23.08, A100 DGX workstation

Contributor Guide