Skip to content

Commit 855c09f

Browse files
committed
add comment explaining casting
1 parent 2f40f6b commit 855c09f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/explorer/polars_backend/series.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,8 @@ defmodule Explorer.PolarsBackend.Series do
855855
value_series =
856856
try do
857857
case {series.dtype, value} do
858+
# cast value to duration of same type as series to ensure durations are correctly
859+
# compared at the same precision
858860
{{:duration, precision}, %Explorer.Duration{}} ->
859861
Series.from_list([value]) |> cast({:duration, precision})
860862

0 commit comments

Comments
 (0)