Skip to content

improve "Data type mismatch" error message #83

Description

@AlJohri

Currently the error message doesn't give enough information to debug what's going on.

Err(arrow2::error::Error::InvalidArgumentError(
"Data type mismatch".to_string(),
))

Something like this helped me debug an issue I was running into:

Err(arrow2::error::Error::InvalidArgumentError(format!(
    "Data type mismatch. Expected: {:?} | Found: {:?}",
    &<ArrowType as ArrowField>::data_type(),
    arr.data_type()
)))

It produced an error message that looks like:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidArgumentError("Data type mismatch. Expected: Struct([...redacted...]) | Found: Struct(...redacted...)")', examples/read_parquet_specific_columns.rs:95:79

Could potentially make it even better by doing a diff.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions