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() }