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 error message for unsupported cast between struct and other types #6724

Open
andygrove opened this issue Nov 12, 2024 · 1 comment
Open
Assignees
Labels
enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers

Comments

@andygrove
Copy link
Member

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

In general, we have detailed error messages for unsupported casts, such as:

_ => Err(ArrowError::CastError(format!(
    "Casting from {from_type:?} to {to_type:?} not supported"

However, the messages for casting between struct and non-struct types does not provide information on the types that were attempted to be cast, making it harder to debug issues.

(Struct(_), _) => Err(ArrowError::CastError(
    "Cannot cast from struct to other types except struct".to_string(),
)),
(_, Struct(_)) => Err(ArrowError::CastError(
    "Cannot cast to struct from other types except struct".to_string(),
)),

Describe the solution you'd like

I would like the error message to follow the same format as other unsupported casts:

"Casting from {from_type:?} to {to_type:?} not supported"

Describe alternatives you've considered

Additional context

@andygrove andygrove added enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers labels Nov 12, 2024
@Silverviles Silverviles removed their assignment Nov 12, 2024
@Silverviles
Copy link

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants