Skip to content

Commit

Permalink
add hour tfm
Browse files Browse the repository at this point in the history
  • Loading branch information
samster25 committed Dec 21, 2023
1 parent 6dbdea3 commit e6ce1bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 1 addition & 3 deletions daft/iceberg/iceberg_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions src/daft-core/src/series/ops/partitioning.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions src/daft-scan/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ partitioning_keys:\n",
Ok(Self(crate::PartitionTransform::Day))
}

#[staticmethod]
pub fn hour() -> PyResult<Self> {
Ok(Self(crate::PartitionTransform::Hour))
}

#[staticmethod]
pub fn void() -> PyResult<Self> {
Ok(Self(crate::PartitionTransform::Void))
Expand Down

0 comments on commit e6ce1bb

Please sign in to comment.