This is an automated email from the ASF dual-hosted git repository.
findepi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 71408cf075 Deprecate unused `ScalarUDF::display_name` (#17168)
71408cf075 is described below
commit 71408cf0753b7f0dc8b66f2cc76f3e6fd7073921
Author: Piotr Findeisen <[email protected]>
AuthorDate: Thu Aug 14 12:40:02 2025 +0200
Deprecate unused `ScalarUDF::display_name` (#17168)
* Deprecate unused `ScalarUDF::display_name`
* Remove old TODO comment
---
datafusion/expr/src/expr.rs | 4 ----
datafusion/expr/src/udf.rs | 10 ++++++++++
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rs
index dbae105889..ce5394d0b1 100644
--- a/datafusion/expr/src/expr.rs
+++ b/datafusion/expr/src/expr.rs
@@ -3247,10 +3247,6 @@ impl Display for Expr {
Expr::ScalarFunction(fun) => {
fmt_function(f, fun.name(), false, &fun.args, true)
}
- // TODO: use udf's display_name, need to fix the separator issue,
<https://github.com/apache/datafusion/issues/10364>
- // Expr::ScalarFunction(ScalarFunction { func, args }) => {
- // write!(f, "{}", func.display_name(args).unwrap())
- // }
Expr::WindowFunction(window_fun) => {
let WindowFunction { fun, params } = window_fun.as_ref();
match fun {
diff --git a/datafusion/expr/src/udf.rs b/datafusion/expr/src/udf.rs
index a2e023c2b2..dcb942e65b 100644
--- a/datafusion/expr/src/udf.rs
+++ b/datafusion/expr/src/udf.rs
@@ -145,7 +145,12 @@ impl ScalarUDF {
/// Returns this function's display_name.
///
/// See [`ScalarUDFImpl::display_name`] for more details
+ #[deprecated(
+ since = "50.0.0",
+ note = "This method is unused and will be removed in a future release"
+ )]
pub fn display_name(&self, args: &[Expr]) -> Result<String> {
+ #[expect(deprecated)]
self.inner.display_name(args)
}
@@ -443,6 +448,10 @@ pub trait ScalarUDFImpl: Debug + DynEq + DynHash + Send +
Sync {
/// function.
///
/// Defaults to `name(args[0], args[1], ...)`
+ #[deprecated(
+ since = "50.0.0",
+ note = "This method is unused and will be removed in a future release"
+ )]
fn display_name(&self, args: &[Expr]) -> Result<String> {
let names: Vec<String> =
args.iter().map(ToString::to_string).collect();
// TODO: join with ", " to standardize the formatting of Vec<Expr>,
<https://github.com/apache/datafusion/issues/10364>
@@ -740,6 +749,7 @@ impl ScalarUDFImpl for AliasedScalarUDFImpl {
}
fn display_name(&self, args: &[Expr]) -> Result<String> {
+ #[expect(deprecated)]
self.inner.display_name(args)
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]