Skip to content

Commit 05e7444

Browse files
committed
use Schema.as_arrow()
1 parent 3dcc344 commit 05e7444

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pyiceberg/table/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,8 +1147,6 @@ def overwrite(
11471147
except ModuleNotFoundError as e:
11481148
raise ModuleNotFoundError("For writes PyArrow needs to be installed") from e
11491149

1150-
from pyiceberg.io.pyarrow import schema_to_pyarrow
1151-
11521150
if not isinstance(df, pa.Table):
11531151
raise ValueError(f"Expected PyArrow table, got: {df}")
11541152

@@ -1160,8 +1158,7 @@ def overwrite(
11601158

11611159
_check_schema(self.schema(), other_schema=df.schema)
11621160
# safe to cast
1163-
pyarrow_schema = schema_to_pyarrow(self.schema())
1164-
df = df.cast(pyarrow_schema)
1161+
df = df.cast(self.schema().as_arrow())
11651162

11661163
with self.transaction() as txn:
11671164
with txn.update_snapshot(snapshot_properties=snapshot_properties).overwrite() as update_snapshot:

0 commit comments

Comments
 (0)