Skip to content

Commit

Permalink
omg
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-ho committed Feb 22, 2024
1 parent 3a271c3 commit 357f433
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion daft/datatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def from_arrow_type(cls, arrow_type: pa.lib.DataType) -> DataType:
elif pa.types.is_date32(arrow_type):
return cls.date()
elif pa.types.is_time64(arrow_type):
timeunit = TimeUnit.from_str(arrow_type.unit)
timeunit = TimeUnit.from_str(pa.type_for_alias(str(arrow_type)).unit)
return cls.time(timeunit)
elif pa.types.is_timestamp(arrow_type):
timeunit = TimeUnit.from_str(arrow_type.unit)
Expand Down
2 changes: 1 addition & 1 deletion daft/expressions/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def lit(value: object) -> Expression:
# pyo3 time (PyTime) is not available when running in abi3 mode, workaround
pa_time = pa.scalar(value)
i64_value = pa_time.cast(pa.int64()).as_py()
time_unit = TimeUnit.from_str(pa_time.type.unit)._timeunit
time_unit = TimeUnit.from_str(pa.type_for_alias(str(pa_time.type)).unit)._timeunit
lit_value = _time_lit(i64_value, time_unit)
elif isinstance(value, Series):
lit_value = _series_lit(value._series)
Expand Down

0 comments on commit 357f433

Please sign in to comment.