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

minor: format Expr::get_type() #11267

Merged
merged 1 commit into from
Jul 5, 2024
Merged

minor: format Expr::get_type() #11267

merged 1 commit into from
Jul 5, 2024

Conversation

jonahgao
Copy link
Member

@jonahgao jonahgao commented Jul 4, 2024

Which issue does this PR close?

N/A

Rationale for this change

The follwoing overlong string literal prevents rustfmt from formatting the match arm in that function.

plan_datafusion_err!("Placeholder type could not be resolved. Make sure that the placeholder is bound to a concrete type, e.g. by providing parameter values.")

Related to rust-lang/rustfmt#3863

What changes are included in this PR?

Use multiple lines to replace the overly long string literal and make cargo fmt work.

Even though we can use the format_strings option to do this automatically, it is unstable, and most IDEs do not enable it by default.

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions bot added the logical-expr Logical plan and expressions label Jul 4, 2024
@@ -237,7 +237,11 @@ impl ExprSchemable for Expr {
Expr::Like { .. } | Expr::SimilarTo { .. } => Ok(DataType::Boolean),
Expr::Placeholder(Placeholder { data_type, .. }) => {
data_type.clone().ok_or_else(|| {
plan_datafusion_err!("Placeholder type could not be resolved. Make sure that the placeholder is bound to a concrete type, e.g. by providing parameter values.")
plan_datafusion_err!(
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the actual change; the others are made by cargo fmt.

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.

Thank you @jonahgao -- 😍

@alamb alamb merged commit a0dd0a1 into apache:main Jul 5, 2024
23 checks passed
@jonahgao jonahgao deleted the format_get_type branch July 6, 2024 00:18
comphead pushed a commit to comphead/arrow-datafusion that referenced this pull request Jul 8, 2024
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants