8000 feat: add register_udaf_fun funcation for dataframe (#49) · nirnayroy/datafusion-python@0f048ad · GitHub
[go: up one dir, main page]

Skip to content

Commit 0f048ad

Browse files
authored
feat: add register_udaf_fun funcation for dataframe (apache#49)
1 parent 7332842 commit 0f048ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/context.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use crate::catalog::{PyCatalog, PyTable};
3434
use crate::dataframe::PyDataFrame;
3535
use crate::dataset::Dataset;
3636
use crate::errors::DataFusionError;
37+
use crate::udaf::PyAggregateUDF;
3738
use crate::udf::PyScalarUDF;
3839
use crate::utils::wait_for_future;
3940

@@ -227,6 +228,11 @@ impl PySessionContext {
227228
Ok(())
228229
}
229230

231+
fn register_udaf(&mut self, udaf: PyAggregateUDF) -> PyResult<()> {
232+
self.ctx.register_udaf(udaf.function);
233+
Ok(())
234+
}
235+
230236
#[args(name = "\"datafusion\"")]
231237
fn catalog(&self, name: &str) -> PyResult<PyCatalog> {
232238
match self.ctx.catalog(name) {

0 commit comments

Comments
 (0)
0