Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Dec 22, 2024
1 parent ed3e8df commit 399415c
Showing 1 changed file with 21 additions and 29 deletions.
50 changes: 21 additions & 29 deletions datafusion/expr/src/type_coercion/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,16 @@ pub fn data_types_with_scalar_udf(
if current_types.is_empty() {
if type_signature.supports_zero_argument() {
return Ok(vec![]);
} else if type_signature.used_to_support_zero_arguments() {
// Special error to help during upgrade: https://github.com/apache/datafusion/issues/13763
return plan_err!("{} does not support zero arguments. Use TypeSignature::Nullary for zero arguments.", func.name());
} else {
if type_signature.used_to_support_zero_arguments() {
// Special error to help during upgrade: https://github.com/apache/datafusion/issues/13763
return plan_err!("{} does not support zero arguments. Use TypeSignature::Nullary for zero arguments.", func.name());
} else {
return plan_err!("{} does not support zero arguments.", func.name());
}
return plan_err!("{} does not support zero arguments.", func.name());
}
}

let valid_types =
get_valid_types_with_scalar_udf(&type_signature, current_types, func)?;
get_valid_types_with_scalar_udf(type_signature, current_types, func)?;

if valid_types
.iter()
Expand Down Expand Up @@ -95,13 +93,11 @@ pub fn data_types_with_aggregate_udf(
if current_types.is_empty() {
if type_signature.supports_zero_argument() {
return Ok(vec![]);
} else if type_signature.used_to_support_zero_arguments() {
// Special error to help during upgrade: https://github.com/apache/datafusion/issues/13763
return plan_err!("{} does not support zero arguments. Use TypeSignature::Nullary for zero arguments.", func.name());
} else {
if type_signature.used_to_support_zero_arguments() {
// Special error to help during upgrade: https://github.com/apache/datafusion/issues/13763
return plan_err!("{} does not support zero arguments. Use TypeSignature::Nullary for zero arguments.", func.name());
} else {
return plan_err!("{} does not support zero arguments.", func.name());
}
return plan_err!("{} does not support zero arguments.", func.name());
}
}

Expand Down Expand Up @@ -134,13 +130,11 @@ pub fn data_types_with_window_udf(
if current_types.is_empty() {
if type_signature.supports_zero_argument() {
return Ok(vec![]);
} else if type_signature.used_to_support_zero_arguments() {
// Special error to help during upgrade: https://github.com/apache/datafusion/issues/13763
return plan_err!("{} does not support zero arguments. Use TypeSignature::Nullary for zero arguments.", func.name());
} else {
if type_signature.used_to_support_zero_arguments() {
// Special error to help during upgrade: https://github.com/apache/datafusion/issues/13763
return plan_err!("{} does not support zero arguments. Use TypeSignature::Nullary for zero arguments.", func.name());
} else {
return plan_err!("{} does not support zero arguments.", func.name());
}
return plan_err!("{} does not support zero arguments.", func.name());
}
}

Expand Down Expand Up @@ -173,19 +167,17 @@ pub fn data_types(
if current_types.is_empty() {
if type_signature.supports_zero_argument() {
return Ok(vec![]);
} else {
if type_signature.used_to_support_zero_arguments() {
// Special error to help during upgrade: https://github.com/apache/datafusion/issues/13763
return plan_err!(
} else if type_signature.used_to_support_zero_arguments() {
// Special error to help during upgrade: https://github.com/apache/datafusion/issues/13763
return plan_err!(
"signature {:?} does not support zero arguments. Use TypeSignature::Nullary for zero arguments.",
type_signature
);
} else {
return plan_err!(
"signature {:?} does not support zero arguments.",
type_signature
);
}
} else {
return plan_err!(
"signature {:?} does not support zero arguments.",
type_signature
);
}
}

Expand Down

0 comments on commit 399415c

Please sign in to comment.