Skip to content

Commit

Permalink
Update Rust bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Aug 1, 2023
1 parent 25b2f1b commit 228b78c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion py-polars/src/functions/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ pub fn cumreduce(lambda: PyObject, exprs: Vec<PyExpr>) -> 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,
Expand All @@ -195,12 +196,14 @@ pub fn datetime(
minute: Option<PyExpr>,
second: Option<PyExpr>,
microsecond: Option<PyExpr>,
time_unit: Wrap<TimeUnit>,
time_zone: Option<TimeZone>,
) -> 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,
Expand All @@ -210,6 +213,8 @@ pub fn datetime(
minute,
second,
microsecond,
time_unit,
time_zone,
};
dsl::datetime(args).into()
}
Expand Down

0 comments on commit 228b78c

Please sign in to comment.