Skip to content

Commit 1f434cc

Browse files
committed
feat: add data_type parameter to expr_fn macro for arrow_cast function
1 parent 54e5e0d commit 1f434cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/functions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,11 @@ macro_rules! expr_fn {
384384
($FUNC: ident, $($arg:ident)*, $DOC: expr) => {
385385
#[doc = $DOC]
386386
#[pyfunction]
387-
fn $FUNC($($arg: PyExpr),*) -> PyExpr {
388-
functions::expr_fn::$FUNC($($arg.into()),*).into()
387+
fn $FUNC($($arg: PyExpr),*, data_type: &str) -> PyExpr {
388+
functions::expr_fn::$FUNC($($arg.into()),*, data_type.to_string()).into()
389389
}
390390
};
391391
}
392-
393392
/// Generates a [pyo3] wrapper for [datafusion::functions::expr_fn]
394393
///
395394
/// These functions take a single `Vec<PyExpr>` argument using `pyo3(signature = (*args))`.
@@ -564,6 +563,7 @@ expr_fn_vec!(r#struct); // Use raw identifier since struct is a keyword
564563
expr_fn_vec!(named_struct);
565564
expr_fn!(from_unixtime, unixtime);
566565
expr_fn!(arrow_typeof, arg_1);
566+
expr_fn!(arrow_cast, expr data_type);
567567
expr_fn!(random);
568568

569569
// Array Functions

0 commit comments

Comments
 (0)