From e6ce1bb4f306d6c7a66847fb2be08c54d3f7f702 Mon Sep 17 00:00:00 2001 From: Sammy Sidhu Date: Wed, 20 Dec 2023 16:28:25 -0800 Subject: [PATCH] add hour tfm --- daft/iceberg/iceberg_scan.py | 4 +--- src/daft-core/src/series/ops/partitioning.rs | 5 +---- src/daft-scan/src/python.rs | 5 +++++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/daft/iceberg/iceberg_scan.py b/daft/iceberg/iceberg_scan.py index 65e32bcfb4..7f852646b7 100644 --- a/daft/iceberg/iceberg_scan.py +++ b/daft/iceberg/iceberg_scan.py @@ -58,9 +58,7 @@ def _iceberg_partition_field_to_daft_partition_field( elif isinstance(transform, DayTransform): tfm = PartitionTransform.day() elif isinstance(transform, HourTransform): - warnings.warn( - "HourTransform not implemented, Please make a comment: https://github.com/Eventual-Inc/Daft/issues/1606" - ) + tfm = PartitionTransform.hour() else: warnings.warn(f"{transform} not implemented, Please make an issue!") return make_partition_field(result_field, daft_field, transform=tfm) diff --git a/src/daft-core/src/series/ops/partitioning.rs b/src/daft-core/src/series/ops/partitioning.rs index beddebf38c..ce0c9084d1 100644 --- a/src/daft-core/src/series/ops/partitioning.rs +++ b/src/daft-core/src/series/ops/partitioning.rs @@ -1,10 +1,7 @@ use crate::datatypes::logical::TimestampArray; use crate::datatypes::{Int32Array, Int64Array, TimeUnit}; use crate::series::array_impl::IntoSeries; -use crate::{ - datatypes::DataType, - series::Series, -}; +use crate::{datatypes::DataType, series::Series}; use common_error::{DaftError, DaftResult}; impl Series { diff --git a/src/daft-scan/src/python.rs b/src/daft-scan/src/python.rs index 4e6cd75ef3..b63d2438d7 100644 --- a/src/daft-scan/src/python.rs +++ b/src/daft-scan/src/python.rs @@ -390,6 +390,11 @@ partitioning_keys:\n", Ok(Self(crate::PartitionTransform::Day)) } + #[staticmethod] + pub fn hour() -> PyResult { + Ok(Self(crate::PartitionTransform::Hour)) + } + #[staticmethod] pub fn void() -> PyResult { Ok(Self(crate::PartitionTransform::Void))