Skip to content

Commit 830fff8

Browse files
committed
use polars default for time_unit
1 parent 0796225 commit 830fff8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dataframely/columns/datetime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def __init__(
333333

334334
@property
335335
def dtype(self) -> pl.DataType:
336-
return pl.Datetime(time_unit="us", time_zone=self.time_zone)
336+
return pl.Datetime(time_zone=self.time_zone)
337337

338338
def validation_rules(self, expr: pl.Expr) -> dict[str, pl.Expr]:
339339
result = super().validation_rules(expr)

dataframely/random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def sample_datetime(
334334
)
335335
# NOTE: polars tracks datetimes relative to epoch
336336
- _datetime_to_microseconds(EPOCH_DATETIME)
337-
).cast(pl.Datetime(time_unit="us", time_zone=time_zone))
337+
).cast(pl.Datetime(time_zone=time_zone))
338338

339339
if resolution is not None:
340340
return result.dt.truncate(resolution)

0 commit comments

Comments
 (0)