geruh commented on code in PR #2843:
URL: https://github.com/apache/iceberg-python/pull/2843#discussion_r2646404096
##########
pyiceberg/io/pyarrow.py:
##########
@@ -1435,6 +1435,13 @@ def primitive(self, primitive: pa.DataType) ->
PrimitiveType:
elif pa.types.is_null(primitive):
# PyArrow null type (pa.null()) is converted to Iceberg UnknownType
# UnknownType can be promoted to any primitive type in V3+ tables
per the Iceberg spec
+ if self._format_version < 3:
+ field_path = ".".join(self._field_names) if self._field_names
else "<root>"
+ raise ValueError(
+ "Null type (pa.null()) is not supported in Iceberg format
version "
+ f"{self._format_version}. Field: {field_path}. "
+ "Use a concrete type (string, int, boolean, etc.) or set
format-version=3."
Review Comment:
nit: wdyt about future proofing with a message like: `Requires v3+ or use a
concrete type.`
--
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]