Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPC Reader panics on data created by Arrow JavaScript #6415

Open
kylebarron opened this issue Sep 18, 2024 · 1 comment
Open

IPC Reader panics on data created by Arrow JavaScript #6415

kylebarron opened this issue Sep 18, 2024 · 1 comment
Labels

Comments

@kylebarron
Copy link
Contributor

Describe the bug

The line here:

field.name().unwrap(),

panics

panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrow-ipc-53.0.0/src/convert.rs:98:30:
called `Option::unwrap()` on a `None` value

on list array data created by Arrow JavaScript, which does not have a name field set. The name is not required to be set.

To Reproduce

This JavaScript code creates this IPC buffer (output data here: data.arrows.zip)

import { tableFromArrays, tableToIPC } from "apache-arrow"
import { Table } from "parquet-wasm"

const table = tableFromArrays({
  column: [[1, 2], [3, 4]],
})
const ipc = tableToIPC(table, "stream")
// This loads the IPC buffer using arrow-rs
Table.fromIPCStream(ipc)

Loading this with pyarrow, we see that the inner list field has no name set (which pyarrow infers as an empty string)

In [1]: import pyarrow as pa

In [3]: pa.ipc.open_stream("data.arrows").read_all()
Out[3]:
pyarrow.Table
column: list<: double>
  child 0, : double
----
column: [[[1,2],[3,4]]]

Expected behavior

IPC Reader should not panic.

Additional context

Originally reported in kylebarron/parquet-wasm#606

@alamb
Copy link
Contributor

alamb commented Sep 18, 2024

Makes sense to me that the reader should not panic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants