Skip to content

Commit

Permalink
Oops
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko committed Apr 11, 2024
1 parent 5025b4a commit e474fda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyiceberg/table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3063,6 +3063,7 @@ def _existing_manifests(self) -> List[ManifestFile]:
def _deleted_entries(self) -> List[ManifestEntry]:
return self._compute_deletes[1]

@property
def rewrites_needed(self) -> bool:
"""Indicate if data files need to be rewritten."""
return self._compute_deletes[2]
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_deletes.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_partitioned_table_rewrite(spark: SparkSession, session_catalog: RestCat
tbl.delete(EqualTo("number", 20))

assert [snapshot.summary.operation.value for snapshot in tbl.snapshots()] == ['append', 'append', 'delete', 'overwrite']
assert tbl.scan().to_arrow().to_pydict() == {'number_partitioned': [11, 11], 'number': [20, 30]}
assert tbl.scan().to_arrow().to_pydict() == {'number_partitioned': [11, 10], 'number': [30, 30]}


@pytest.mark.parametrize("format_version", [1, 2])
Expand Down Expand Up @@ -169,5 +169,5 @@ def test_partitioned_table_positional_deletes(spark: SparkSession, session_catal
# Yet another wrong status by Spark
# One positional delete has been added, but an OVERWRITE status is set
# Related issue https://github.com/apache/iceberg/issues/9995
assert [snapshot.summary.operation.value for snapshot in tbl.snapshots()] == ['append', 'overwrite', 'delete']
assert [snapshot.summary.operation.value for snapshot in tbl.snapshots()] == ['append', 'overwrite', 'delete', 'overwrite']
assert tbl.scan().to_arrow().to_pydict() == {'number_partitioned': [10], 'number': [20]}

0 comments on commit e474fda

Please sign in to comment.