From 228b78cfda578a7b7eb1670e1865c807b40aa61d Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Tue, 1 Aug 2023 20:00:55 +0200 Subject: [PATCH] Update Rust bindings --- py-polars/src/functions/lazy.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/py-polars/src/functions/lazy.rs b/py-polars/src/functions/lazy.rs index 904d4813837e1..763cb01895515 100644 --- a/py-polars/src/functions/lazy.rs +++ b/py-polars/src/functions/lazy.rs @@ -187,6 +187,7 @@ pub fn cumreduce(lambda: PyObject, exprs: Vec) -> PyExpr { } #[pyfunction] +#[pyo3(signature = (year, month, day, hour=None, minute=None, second=None, microsecond=None, time_unit=Wrap(TimeUnit::Microseconds), time_zone=None))] pub fn datetime( year: PyExpr, month: PyExpr, @@ -195,12 +196,14 @@ pub fn datetime( minute: Option, second: Option, microsecond: Option, + time_unit: Wrap, + time_zone: Option, ) -> PyExpr { let year = year.inner; let month = month.inner; let day = day.inner; - set_unwrapped_or_0!(hour, minute, second, microsecond); + let time_unit = time_unit.0; let args = DatetimeArgs { year, @@ -210,6 +213,8 @@ pub fn datetime( minute, second, microsecond, + time_unit, + time_zone, }; dsl::datetime(args).into() }