moriyoshi commented on code in PR #8144:
URL: https://github.com/apache/iceberg/pull/8144#discussion_r1308182494
##########
python/pyiceberg/io/pyarrow.py:
##########
@@ -541,9 +542,16 @@ def _combine_positional_deletes(positional_deletes:
List[pa.ChunkedArray], rows:
return np.setdiff1d(np.arange(rows), all_chunks, assume_unique=False)
-def pyarrow_to_schema(schema: pa.Schema) -> Schema:
- visitor = _ConvertToIceberg()
- return visit_pyarrow(schema, visitor)
+def pyarrow_to_schema(
+ schema: pa.Schema,
+ projected_schema: Optional[Schema] = None,
+ match_with_field_name: bool = False,
+ ignore_unprojectable_fields: bool = False,
+) -> Schema:
+ visitor = _ConvertToIceberg(projected_schema, match_with_field_name,
ignore_unprojectable_fields)
+ ib_schema = visit_pyarrow(schema, visitor)
+ assert isinstance(ib_schema, StructType)
Review Comment:
This is not intended to warn the user for wrong usage. This is a type guard
for mypy and I believe it's valid.
--
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]