Skip to content

Commit

Permalink
refactor(rust): Add missing implicit datetime alias in ExprIR (#18809)
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp committed Sep 18, 2024
1 parent ffc7a70 commit 8114b52
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions crates/polars-plan/src/dsl/functions/temporal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,21 +208,25 @@ pub fn datetime(args: DatetimeArgs) -> Expr {
ambiguous,
];

Expr::Function {
input,
function: FunctionExpr::TemporalExpr(TemporalFunction::DatetimeFunction {
time_unit,
time_zone,
Expr::Alias(
Arc::new(Expr::Function {
input,
function: FunctionExpr::TemporalExpr(TemporalFunction::DatetimeFunction {
time_unit,
time_zone,
}),
options: FunctionOptions {
collect_groups: ApplyOptions::ElementWise,
flags: FunctionFlags::default()
| FunctionFlags::INPUT_WILDCARD_EXPANSION
| FunctionFlags::ALLOW_RENAME,
fmt_str: "datetime",
..Default::default()
},
}),
options: FunctionOptions {
collect_groups: ApplyOptions::ElementWise,
flags: FunctionFlags::default()
| FunctionFlags::INPUT_WILDCARD_EXPANSION
| FunctionFlags::ALLOW_RENAME,
fmt_str: "datetime",
..Default::default()
},
}
// TODO: follow left-hand rule in Polars 2.0.
PlSmallStr::from_static("datetime"),
)
}

/// Arguments used by `duration` in order to produce an [`Expr`] of [`Duration`]
Expand Down

0 comments on commit 8114b52

Please sign in to comment.