From a1c46a2a70d3bd920700cc1c4f8e52db075e78a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kriszti=C3=A1n=20Sz=C5=B1cs?= Date: Tue, 28 Feb 2023 11:13:43 +0100 Subject: [PATCH] fix(ir): use `rlz.map_to()` rule instead of `isin` to normalize temporal units --- ibis/expr/operations/temporal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ibis/expr/operations/temporal.py b/ibis/expr/operations/temporal.py index 5d7e0a561242..a5ca683e7cb8 100644 --- a/ibis/expr/operations/temporal.py +++ b/ibis/expr/operations/temporal.py @@ -81,7 +81,7 @@ class TimestampUnary(Unary): @public class TimestampTruncate(Value): arg = rlz.timestamp - unit = rlz.isin(_timestamp_units) + unit = rlz.map_to(_timestamp_units) output_shape = rlz.shape_like("arg") output_dtype = dt.timestamp @@ -90,7 +90,7 @@ class TimestampTruncate(Value): @public class DateTruncate(Value): arg = rlz.date - unit = rlz.isin(_date_units) + unit = rlz.map_to(_date_units) output_shape = rlz.shape_like("arg") output_dtype = dt.date @@ -99,7 +99,7 @@ class DateTruncate(Value): @public class TimeTruncate(Value): arg = rlz.time - unit = rlz.isin(_time_units) + unit = rlz.map_to(_time_units) output_shape = rlz.shape_like("arg") output_dtype = dt.time