Skip to content

Commit

Permalink
fix(ir): use rlz.map_to() rule instead of isin to normalize tempo…
Browse files Browse the repository at this point in the history
…ral units
  • Loading branch information
kszucs authored and cpcloud committed Feb 28, 2023
1 parent b3601c6 commit a1c46a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ibis/expr/operations/temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a1c46a2

Please sign in to comment.