Fokko commented on code in PR #1345:
URL: https://github.com/apache/iceberg-python/pull/1345#discussion_r1917829595
##########
pyiceberg/transforms.py:
##########
@@ -193,6 +195,24 @@ def supports_pyarrow_transform(self) -> bool:
@abstractmethod
def pyarrow_transform(self, source: IcebergType) -> "Callable[[pa.Array],
pa.Array]": ...
+ def _pyiceberg_transform_wrapper(
+ self, transform_func: Callable[["ArrayLike", Any], "ArrayLike"],
*args: Any
+ ) -> Callable[["ArrayLike"], "ArrayLike"]:
+ import pyarrow as pa
Review Comment:
```suggestion
try:
import pyarrow as pa
except ModuleNotFoundError as e:
raise ModuleNotFoundError("For bucket/truncate transforms,
PyArrow needs to be installed") from e
```
--
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]