Skip to content

Commit

Permalink
accidental typo
Browse files Browse the repository at this point in the history
  • Loading branch information
rancomp committed Oct 19, 2023
1 parent 0bb8d0b commit 3ba6697
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion py-polars/polars/utils/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def _datetime_to_pl_timestamp(dt: datetime, time_unit: TimeUnit | None) -> int:
f"`time_unit` must be one of {{'ms', 'us', 'ns'}}, got {time_unit!r}"
)


def _timedelta_to_pl_timedelta(td: timedelta, time_unit: TimeUnit | None) -> int:
"""Convert a Python timedelta object to a total number of subseconds."""
microseconds = td.microseconds
Expand Down Expand Up @@ -179,7 +180,7 @@ def _to_python_datetime(
if time_unit == "us":
return EPOCH + timedelta(microseconds=value)
elif time_unit == "ns":
return EPOCH + timedelt (microseconds=value // 1_000)
return EPOCH + timedelta(microseconds=value // 1_000)
elif time_unit == "ms":
return EPOCH + timedelta(milliseconds=value)
else:
Expand Down

0 comments on commit 3ba6697

Please sign in to comment.