diff --git a/pyiceberg/io/pyarrow.py b/pyiceberg/io/pyarrow.py index 7a94ce4c7d..9e05e2dd4d 100644 --- a/pyiceberg/io/pyarrow.py +++ b/pyiceberg/io/pyarrow.py @@ -1735,7 +1735,10 @@ def write_file(table: Table, tasks: Iterator[WriteTask]) -> Iterator[DataFile]: file_format=FileFormat.PARQUET, partition=Record(), file_size_in_bytes=len(fo), - sort_order_id=task.sort_order_id, + # After this has been fixed: + # https://github.com/apache/iceberg-python/issues/271 + # sort_order_id=task.sort_order_id, + sort_order_id=None, # Just copy these from the table for now spec_id=table.spec().spec_id, equality_ids=None, diff --git a/pyiceberg/table/__init__.py b/pyiceberg/table/__init__.py index 16ed9ed292..e3975dcac5 100644 --- a/pyiceberg/table/__init__.py +++ b/pyiceberg/table/__init__.py @@ -943,9 +943,6 @@ def append(self, df: pa.Table) -> None: if len(self.spec().fields) > 0: raise ValueError("Cannot write to partitioned tables") - if len(self.sort_order().fields) > 0: - raise ValueError("Cannot write to tables with a sort-order") - data_files = _dataframe_to_data_files(self, df=df) merge = _MergingSnapshotProducer(operation=Operation.APPEND, table=self) for data_file in data_files: @@ -976,9 +973,6 @@ def overwrite(self, df: pa.Table, overwrite_filter: BooleanExpression = ALWAYS_T if len(self.spec().fields) > 0: raise ValueError("Cannot write to partitioned tables") - if len(self.sort_order().fields) > 0: - raise ValueError("Cannot write to tables with a sort-order") - data_files = _dataframe_to_data_files(self, df=df) merge = _MergingSnapshotProducer( operation=Operation.OVERWRITE if self.current_snapshot() is not None else Operation.APPEND, @@ -2279,9 +2273,6 @@ def _dataframe_to_data_files(table: Table, df: pa.Table) -> Iterable[DataFile]: if len(table.spec().fields) > 0: raise ValueError("Cannot write to partitioned tables") - if len(table.sort_order().fields) > 0: - raise ValueError("Cannot write to tables with a sort-order") - write_uuid = uuid.uuid4() counter = itertools.count(0)