benihildebrand commented on code in PR #703:
URL: https://github.com/apache/iceberg-python/pull/703#discussion_r1594581596
##########
pyiceberg/transforms.py:
##########
@@ -515,6 +583,19 @@ def __repr__(self) -> str:
"""Return the string representation of the HourTransform class."""
return "HourTransform()"
+ def pyarrow_transform(self, source: IcebergType) -> "Callable[[pa.Array],
pa.Array]":
+ import pyarrow as pa
+ import pyarrow.compute as pc
+
+ if isinstance(source, TimestampType):
+ epoch = datetime.EPOCH_TIMESTAMP
+ elif isinstance(source, TimestamptzType):
+ epoch = datetime.EPOCH_TIMESTAMPTZ
+ else:
+ raise ValueError(f"Cannot apply month transform for type:
{source}")
Review Comment:
"Cannot apply month transform for type" should be referring to 'hour', not
'month'.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]