DevChrisCross commented on code in PR #1498:
URL: https://github.com/apache/iceberg-python/pull/1498#discussion_r1911914991
##########
pyiceberg/exceptions.py:
##########
@@ -122,3 +125,19 @@ class CommitStateUnknownException(RESTError):
class WaitingForLockException(Exception):
"""Need to wait for a lock, try again."""
+
+
+class UnsupportedPyArrowTypeException(Exception):
+ """Cannot convert PyArrow type to corresponding Iceberg type."""
+
+ def __init__(self, field: pa.Field, *args: Any):
+ self.field = field
Review Comment:
I believe the issue also raise, if possible, to also actually include the
`field` itself so in case they wanted to catch the exception, they could handle
it more gracefully. Perhaps @vtk9 can provide more on the use case. :)
For reference:
_Even better, instead of raising a TypeError can a more specific error be
returned (such as UnsupportedPyArrowType) which includes the pyarrow.Field
(column_name, column_type) as an attribute so that this error can be caught and
different exception re-raised based on information contained inside
UnsupportedPyArrowType_
--
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]