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

Pretty print a RecordBatch containing Float16 triggers a panic #1193

Closed
helgikrs opened this issue Jan 17, 2022 · 0 comments · Fixed by #1194
Closed

Pretty print a RecordBatch containing Float16 triggers a panic #1193

helgikrs opened this issue Jan 17, 2022 · 0 comments · Fixed by #1194
Assignees
Labels
arrow Changes to the arrow crate bug

Comments

@helgikrs
Copy link
Contributor

Describe the bug
Pretty printing a record batch containing a float16 column produces an error

panicked at 'called `Option::unwrap()` on a `None` value', arrow/src/util/display.rs:316:30

To Reproduce

Create a record batch containing a float16 array and call pretty_format_batches on it, like so:

let values = vec![
    Some(f16::from_f32(f32::NAN)),
    Some(f16::from_f32(4.0)),
    Some(f16::from_f32(f32::NEG_INFINITY)),
];
let array = Arc::new(values.into_iter().collect::<Float16Array>()) as ArrayRef;

let schema = Arc::new(Schema::new(vec![Field::new(
    "f16",
    array.data_type().clone(),
    true,
)]));

let batch = RecordBatch::try_new(schema, vec![array])?;

let table = pretty_format_batches(&[batch])?.to_string();

Expected behavior
Should pretty print the record batch.

Additional context
Add any other context about the problem here.

@helgikrs helgikrs added the bug label Jan 17, 2022
@alamb alamb changed the title Pretty print a record batch containing float16 triggers a panic Pretty print a RecordBatch containing Float16 triggers a panic Jan 20, 2022
@alamb alamb added the arrow Changes to the arrow crate label Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants