Skip to content

Improve downcast_value! macro #14683

New issue

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

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

Already on GitHub? # to your account

Conversation

findepi
Copy link
Member

@findepi findepi commented Feb 15, 2025

  • When downcast_value! errors out, include actual type in the error message, beside the expected.
  • Also improve macro hygiene of that macro by not requiring callers to import DataFusionError themselves
  • add (optional) backtraces by using proper constructor macro for the DataFusionError

@github-actions github-actions bot added common Related to common crate functions Changes to functions implementation labels Feb 15, 2025
@findepi findepi force-pushed the findepi/improve-error-message-for-downcast-value-d725d4 branch from fafdad6 to d13ce45 Compare February 15, 2025 18:18
When `downcast_value!` errors out, include actual type in the error
message, beside the expected.

Also improve macro hygiene of that macro by importing `DataFusionError`
correctly.
@findepi findepi force-pushed the findepi/improve-error-message-for-downcast-value-d725d4 branch from d13ce45 to be43268 Compare February 15, 2025 18:51
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @findepi -- looks good to me

@alamb alamb mentioned this pull request Feb 16, 2025
@findepi findepi force-pushed the findepi/improve-error-message-for-downcast-value-d725d4 branch from 0ffd5a4 to 291dd89 Compare February 16, 2025 21:14
@findepi findepi changed the title Improve error message for downcast_value! Improve downcast_value! macro Feb 16, 2025
@findepi findepi merged commit 763bd68 into apache:main Feb 17, 2025
26 checks passed
@findepi findepi deleted the findepi/improve-error-message-for-downcast-value-d725d4 branch February 17, 2025 07:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
common Related to common crate functions Changes to functions implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants