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

improve "Data type mismatch" error message #83

Open
AlJohri opened this issue Oct 30, 2022 · 2 comments
Open

improve "Data type mismatch" error message #83

AlJohri opened this issue Oct 30, 2022 · 2 comments

Comments

@AlJohri
Copy link

AlJohri commented Oct 30, 2022

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.

@ncpenke
Copy link
Collaborator

ncpenke commented Oct 30, 2022

Great idea!

@ncpenke
Copy link
Collaborator

ncpenke commented Oct 30, 2022

Blocked by #54

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

No branches or pull requests

2 participants