Fokko commented on code in PR #8267:
URL: https://github.com/apache/iceberg/pull/8267#discussion_r1288236661
##########
python/pyiceberg/io/pyarrow.py:
##########
@@ -451,7 +451,7 @@ def visit_binary(self, _: BinaryType) -> pa.DataType:
def _convert_scalar(value: Any, iceberg_type: IcebergType) -> pa.scalar:
if not isinstance(iceberg_type, PrimitiveType):
raise ValueError(f"Expected primitive type, got: {iceberg_type}")
- return pa.scalar(value).cast(schema_to_pyarrow(iceberg_type))
+ return pa.scalar(value=value, type=schema_to_pyarrow(iceberg_type))
Review Comment:
I'm not aware of the exact semantics of this change, but I've added a couple
of tests recently that cover this, so I think we're good.
--
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]