Skip to content

Commit

Permalink
bugfix: ignore nested struct cast error
Browse files Browse the repository at this point in the history
workaround for: ttps://github.com/apache/arrow/pull/43782
  • Loading branch information
yota-p authored Nov 16, 2024
1 parent b2f0a9e commit 8d634ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyiceberg/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,9 @@ def _is_field_compatible(self, lhs: NestedField) -> bool:

def schema(self, schema: Schema, struct_result: Callable[[], bool]) -> bool:
if not (result := struct_result()):
if any([isinstance(field.field_type, (ListType, MapType, StructType)) for field in schema.fields]):
self.console.print(f"ignoring mismatch since this schema includes struct, which cannot be validated correctly: https://github.com/apache/arrow/pull/43782")
return True
self.console.print(self.rich_table)
raise ValueError(f"Mismatch in fields:\n{self.console.export_text()}")
return result
Expand Down

0 comments on commit 8d634ad

Please sign in to comment.