NVIDIA / NVIDIA/cudf

[FEA] Support inferring column names when using the `byte_range=` parameter in `read_csv`

Open
#12,331 0 comments 0 reactions 0 assignees View on GitHub
bug cuIO libcudf Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

I cannot use the `byte_range` parameter with `read_csv` if the column names need to be inferred.

```python
>>> cudf.read_csv(StringIO("1,2,3\n4,5,6"), dtype=int, byte_range=(3, 6))
RuntimeError: cuDF failure at: cudf/cpp/src/io/csv/reader_impl.cu:438: byte_range offset with header not supported
```

But this works:

```python
>>> cudf.read_csv(StringIO("1,2,3\n4,5,6"), dtype=int, byte_range=(3, 6), names=['x', 'y', 'z'])
x y z
0 4 5 6
```

And this works:

```python
>>> cudf.read_csv(StringIO("1,2,3\n4,5,6"), dtype=int, byte_range=(3, 6), header=None)
0 1 2
0 4 5 6
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.