@@ -96,6 +96,7 @@ fn array_cat(exprs: Vec<PyExpr>) -> PyExpr {
9696}
9797
9898#[ pyfunction]
99+ #[ pyo3( signature = ( array, element, index=None ) ) ]
99100fn array_position ( array : PyExpr , element : PyExpr , index : Option < i64 > ) -> PyExpr {
100101 let index = ScalarValue :: Int64 ( index) ;
101102 let index = Expr :: Literal ( index) ;
@@ -104,6 +105,7 @@ fn array_position(array: PyExpr, element: PyExpr, index: Option<i64>) -> PyExpr
104105}
105106
106107#[ pyfunction]
108+ #[ pyo3( signature = ( array, begin, end, stride=None ) ) ]
107109fn array_slice ( array : PyExpr , begin : PyExpr , end : PyExpr , stride : Option < PyExpr > ) -> PyExpr {
108110 datafusion:: functions_nested:: expr_fn:: array_slice (
109111 array. into ( ) ,
@@ -142,16 +144,19 @@ fn concat_ws(sep: String, args: Vec<PyExpr>) -> PyResult<PyExpr> {
142144}
143145
144146#[ pyfunction]
147+ #[ pyo3( signature = ( values, regex, flags=None ) ) ]
145148fn regexp_like ( values : PyExpr , regex : PyExpr , flags : Option < PyExpr > ) -> PyResult < PyExpr > {
146149 Ok ( functions:: expr_fn:: regexp_like ( values. expr , regex. expr , flags. map ( |x| x. expr ) ) . into ( ) )
147150}
148151
149152#[ pyfunction]
153+ #[ pyo3( signature = ( values, regex, flags=None ) ) ]
150154fn regexp_match ( values : PyExpr , regex : PyExpr , flags : Option < PyExpr > ) -> PyResult < PyExpr > {
151155 Ok ( functions:: expr_fn:: regexp_match ( values. expr , regex. expr , flags. map ( |x| x. expr ) ) . into ( ) )
152156}
153157
154158#[ pyfunction]
159+ #[ pyo3( signature = ( string, pattern, replacement, flags=None ) ) ]
155160/// Replaces substring(s) matching a POSIX regular expression.
156161fn regexp_replace (
157162 string : PyExpr ,
@@ -283,6 +288,7 @@ fn find_window_fn(name: &str, ctx: Option<PySessionContext>) -> PyResult<WindowF
283288
284289/// Creates a new Window function expression
285290#[ pyfunction]
291+ #[ pyo3( signature = ( name, args, partition_by=None , order_by=None , window_frame=None , ctx=None ) ) ]
286292fn window (
287293 name : & str ,
288294 args : Vec < PyExpr > ,
@@ -331,6 +337,7 @@ macro_rules! aggregate_function {
331337 } ;
332338 ( $NAME: ident, $( $arg: ident) * ) => {
333339 #[ pyfunction]
340+ #[ pyo3( signature = ( $( $arg) ,* , distinct=None , filter=None , order_by=None , null_treatment=None ) ) ]
334341 fn $NAME(
335342 $( $arg: PyExpr ) ,* ,
336343 distinct: Option <bool >,
@@ -351,6 +358,7 @@ macro_rules! aggregate_function_vec_args {
351358 } ;
352359 ( $NAME: ident, $( $arg: ident) * ) => {
353360 #[ pyfunction]
361+ #[ pyo3( signature = ( $( $arg) ,* , distinct=None , filter=None , order_by=None , null_treatment=None ) ) ]
354362 fn $NAME(
355363 $( $arg: PyExpr ) ,* ,
356364 distinct: Option <bool >,
@@ -624,6 +632,7 @@ aggregate_function!(approx_median);
624632// aggregate_function!(grouping);
625633
626634#[ pyfunction]
635+ #[ pyo3( signature = ( expression, percentile, num_centroids=None , filter=None ) ) ]
627636pub fn approx_percentile_cont (
628637 expression : PyExpr ,
629638 percentile : f64 ,
@@ -642,6 +651,7 @@ pub fn approx_percentile_cont(
642651}
643652
644653#[ pyfunction]
654+ #[ pyo3( signature = ( expression, weight, percentile, filter=None ) ) ]
645655pub fn approx_percentile_cont_with_weight (
646656 expression : PyExpr ,
647657 weight : PyExpr ,
@@ -662,6 +672,7 @@ aggregate_function_vec_args!(last_value);
662672// We handle first_value explicitly because the signature expects an order_by
663673// https://github.com/apache/datafusion/issues/12376
664674#[ pyfunction]
675+ #[ pyo3( signature = ( expr, distinct=None , filter=None , order_by=None , null_treatment=None ) ) ]
665676pub fn first_value (
666677 expr : PyExpr ,
667678 distinct : Option < bool > ,
@@ -677,6 +688,7 @@ pub fn first_value(
677688
678689// nth_value requires a non-expr argument
679690#[ pyfunction]
691+ #[ pyo3( signature = ( expr, n, distinct=None , filter=None , order_by=None , null_treatment=None ) ) ]
680692pub fn nth_value (
681693 expr : PyExpr ,
682694 n : i64 ,
@@ -691,6 +703,7 @@ pub fn nth_value(
691703
692704// string_agg requires a non-expr argument
693705#[ pyfunction]
706+ #[ pyo3( signature = ( expr, delimiter, distinct=None , filter=None , order_by=None , null_treatment=None ) ) ]
694707pub fn string_agg (
695708 expr : PyExpr ,
696709 delimiter : String ,
@@ -730,6 +743,7 @@ fn add_builder_fns_to_window(
730743}
731744
732745#[ pyfunction]
746+ #[ pyo3( signature = ( arg, shift_offset, default_value=None , partition_by=None , order_by=None ) ) ]
733747pub fn lead (
734748 arg : PyExpr ,
735749 shift_offset : i64 ,
@@ -743,6 +757,7 @@ pub fn lead(
743757}
744758
745759#[ pyfunction]
760+ #[ pyo3( signature = ( arg, shift_offset, default_value=None , partition_by=None , order_by=None ) ) ]
746761pub fn lag (
747762 arg : PyExpr ,
748763 shift_offset : i64 ,
@@ -756,13 +771,15 @@ pub fn lag(
756771}
757772
758773#[ pyfunction]
774+ #[ pyo3( signature = ( partition_by=None , order_by=None ) ) ]
759775pub fn rank ( partition_by : Option < Vec < PyExpr > > , order_by : Option < Vec < PyExpr > > ) -> PyResult < PyExpr > {
760776 let window_fn = window_function:: rank ( ) ;
761777
762778 add_builder_fns_to_window ( window_fn, partition_by, order_by)
763779}
764780
765781#[ pyfunction]
782+ #[ pyo3( signature = ( partition_by=None , order_by=None ) ) ]
766783pub fn dense_rank (
767784 partition_by : Option < Vec < PyExpr > > ,
768785 order_by : Option < Vec < PyExpr > > ,
@@ -773,6 +790,7 @@ pub fn dense_rank(
773790}
774791
775792#[ pyfunction]
793+ #[ pyo3( signature = ( partition_by=None , order_by=None ) ) ]
776794pub fn percent_rank (
777795 partition_by : Option < Vec < PyExpr > > ,
778796 order_by : Option < Vec < PyExpr > > ,
@@ -783,6 +801,7 @@ pub fn percent_rank(
783801}
784802
785803#[ pyfunction]
804+ #[ pyo3( signature = ( partition_by=None , order_by=None ) ) ]
786805pub fn cume_dist (
787806 partition_by : Option < Vec < PyExpr > > ,
788807 order_by : Option < Vec < PyExpr > > ,
@@ -793,6 +812,7 @@ pub fn cume_dist(
793812}
794813
795814#[ pyfunction]
815+ #[ pyo3( signature = ( arg, partition_by=None , order_by=None ) ) ]
796816pub fn ntile (
797817 arg : PyExpr ,
798818 partition_by : Option < Vec < PyExpr > > ,
0 commit comments