Skip to content

Commit d7356f9

Browse files
committed
remove arrow schema cast
1 parent 7dff359 commit d7356f9

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

pyiceberg/table/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,6 @@ def append(self, df: pa.Table, snapshot_properties: Dict[str, str] = EMPTY_DICT)
484484
)
485485

486486
_check_schema_compatible(self._table.schema(), other_schema=df.schema)
487-
# cast if the two schemas are compatible but not equal
488-
table_arrow_schema = self._table.schema().as_arrow()
489-
if table_arrow_schema != df.schema:
490-
df = df.cast(table_arrow_schema)
491487

492488
with self.update_snapshot(snapshot_properties=snapshot_properties).fast_append() as update_snapshot:
493489
# skip writing data files if the dataframe is empty
@@ -525,10 +521,6 @@ def overwrite(
525521
raise ValueError("Cannot write to partitioned tables")
526522

527523
_check_schema_compatible(self._table.schema(), other_schema=df.schema)
528-
# cast if the two schemas are compatible but not equal
529-
table_arrow_schema = self._table.schema().as_arrow()
530-
if table_arrow_schema != df.schema:
531-
df = df.cast(table_arrow_schema)
532524

533525
with self.update_snapshot(snapshot_properties=snapshot_properties).overwrite() as update_snapshot:
534526
# skip writing data files if the dataframe is empty

0 commit comments

Comments
 (0)