Fokko commented on code in PR #2155:
URL: https://github.com/apache/iceberg-python/pull/2155#discussion_r2281698120
##########
pyiceberg/schema.py:
##########
@@ -1618,6 +1618,11 @@ def promote(file_type: IcebergType, read_type:
IcebergType) -> IcebergType:
raise ResolveError(f"Cannot promote {file_type} to {read_type}")
[email protected](UnknownType)
+def _(file_type: UnknownType, read_type: IcebergType) -> IcebergType:
+ return read_type # Per V3 Spec, "Unknown" can be promoted to any type
Review Comment:
I think we need to extend this logic a bit:
```suggestion
# Per V3 Spec, "Unknown" can be promoted to any Primitive type
if isinstance(read_type, PrimitiveType):
return file_type
else:
raise ResolveError(f"Cannot promote {file_type} to {read_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]