Skip to content

Commit

Permalink
search default aggregate functions by both name and aliases
Browse files Browse the repository at this point in the history
The alias list no longer includes the name of the function.

Ref: apache/datafusion#10658
  • Loading branch information
Michael-J-Ward committed Jul 25, 2024
1 parent 06e2704 commit df2cbad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ fn find_window_fn(name: &str, ctx: Option<PySessionContext>) -> PyResult<WindowF
// search default aggregate functions
let agg_fn = all_default_aggregate_functions()
.iter()
.find(|v| v.aliases().contains(&name.to_string()))
.find(|v| v.name() == name || v.aliases().contains(&name.to_string()))
.map(|f| WindowFunctionDefinition::AggregateUDF(f.clone()));

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

Ok(())
}
}

0 comments on commit df2cbad

Please sign in to comment.