From 357f4332bcd5ab0a91ece576baaa8a407a2ee1eb Mon Sep 17 00:00:00 2001 From: Colin Ho Date: Fri, 16 Feb 2024 17:53:27 +0800 Subject: [PATCH] omg --- daft/datatype.py | 2 +- daft/expressions/expressions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/daft/datatype.py b/daft/datatype.py index 25d782b2bf..c71717eb90 100644 --- a/daft/datatype.py +++ b/daft/datatype.py @@ -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) diff --git a/daft/expressions/expressions.py b/daft/expressions/expressions.py index 7267052994..7165123752 100644 --- a/daft/expressions/expressions.py +++ b/daft/expressions/expressions.py @@ -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)