Skip to content

Commit df2cbad

Browse files
search default aggregate functions by both name and aliases
The alias list no longer includes the name of the function. Ref: apache/datafusion#10658
1 parent 06e2704 commit df2cbad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/functions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ fn find_window_fn(name: &str, ctx: Option<PySessionContext>) -> PyResult<WindowF
658658
// search default aggregate functions
659659
let agg_fn = all_default_aggregate_functions()
660660
.iter()
661-
.find(|v| v.aliases().contains(&name.to_string()))
661+
.find(|v| v.name() == name || v.aliases().contains(&name.to_string()))
662662
.map(|f| WindowFunctionDefinition::AggregateUDF(f.clone()));
663663

664664
if let Some(agg_fn) = agg_fn {
@@ -1226,4 +1226,4 @@ pub(crate) fn init_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
12261226
m.add_wrapped(wrap_pyfunction!(flatten))?;
12271227

12281228
Ok(())
1229-
}
1229+
}

0 commit comments

Comments
 (0)