meta-pytorch / meta-pytorch/data
Cannot read from parquet files that contain binary
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.3k
- Forks
- 179
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 2
Description
🐛 Describe the bug
I create some parquet files with the following:
def save_tensor(t):
buf = io.BytesIO()
th.save(t, buf)
return buf.getvalue()
for idx, batch in enumerate(tqdm(dl, total=total_files / args.batch_size)):
df = pa.table({"img": [save_tensor(item) for item in batch]})
pq.write_table(df, out_dir / f"{idx}.parquet")
when I try to read the parquet files, with the following pipe:
datapipe = dp.iter.FSSpecFileLister(dir)
datapipe = datapipe.load_parquet_as_df()
I get the error:
NotImplementedError: Unsupported Arrow type: binary
This exception is thrown by iter of ParquetDFLoaderIterDataPipe(columns=None, device='', dtype=None, > source_dp=FSSpecFileListerIterDataPipe, use_threads=False)
Versions
Collecting environment information...
PyTorch version: 1.12.0+cu102
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04 LTS (x86_64)
GCC version: (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35
Python version: 3.9.12 (main, Jun 1 2022, 11:38:51) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.15.0-41-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1080 Ti
Nvidia driver version: 515.48.07
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.4
[pip3] pytorch-ranger==0.1.1
[pip3] torch==1.12.0
[pip3] torch-optimizer==0.1.0
[pip3] torcharrow==0.1.0
[pip3] torchdata==0.4.0
[pip3] torchmetrics==0.7.3
[pip3] torchvision==0.13.0
[conda] cudatoolkit 11.7.0 hd8887f6_10 conda-forge
[conda] numpy 1.21.4 pypi_0 pypi
[conda] pytorch-ranger 0.1.1 pypi_0 pypi
[conda] torch 1.12.0 pypi_0 pypi
[conda] torch-optimizer 0.1.0 pypi_0 pypi
[conda] torcharrow 0.1.0 pypi_0 pypi
[conda] torchdata 0.4.0 pypi_0 pypi
[conda] torchmetrics 0.7.3 pypi_0 pypi
[conda] torchvision 0.13.0 pypi_0 pypi
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.
Research direction
Start at datapipe.load_parquet_as_df() and the ParquetDFLoaderIterDataPipe path shown in the error, then trace how Arrow binary columns are converted. Reproduce the issue with the provided save_tensor, pa.table, and pq.write_table example; done means the generated parquet file loads without the Unsupported Arrow type: binary error. The payload names no source file or test, so locate those first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100