Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite manifests #1661

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lint
  • Loading branch information
amitgilad3 committed Feb 13, 2025
commit b434828abed724ee3994fe551f0b3819f403f4f3
7 changes: 3 additions & 4 deletions pyiceberg/table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
update_table_metadata,
)
from pyiceberg.table.update.schema import UpdateSchema
from pyiceberg.table.update.snapshot import ManageSnapshots, UpdateSnapshot, _FastAppendFiles, RewriteManifestsResult
from pyiceberg.table.update.snapshot import ManageSnapshots, UpdateSnapshot, _FastAppendFiles
from pyiceberg.table.update.spec import UpdateSpec
from pyiceberg.table.update.statistics import UpdateStatistics
from pyiceberg.transforms import IdentityTransform
Expand Down Expand Up @@ -1171,7 +1171,7 @@ def add_files(
def rewrite_manifests(
self,
spec_id: Optional[int] = None,
) -> RewriteManifestsResult:
) -> None:
"""
Shorthand API for Rewriting manifests for the table.

Expand All @@ -1180,8 +1180,7 @@ def rewrite_manifests(

"""
with self.transaction() as tx:
rewrite_results = tx.rewrite_manifests(spec_id=spec_id)
return rewrite_results
tx.rewrite_manifests(spec_id=spec_id)

def update_spec(self, case_sensitive: bool = True) -> UpdateSpec:
return UpdateSpec(Transaction(self, autocommit=True), case_sensitive=case_sensitive)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_writes/test_rewrite_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_summaries(spark: SparkSession, session_catalog: Catalog, arrow_table_wi
manifests = tbl.inspect.all_manifests().to_pylist()
assert len(manifests) == 3, "Should have 3 manifests before rewrite"

result = tbl.rewrite_manifests()
tbl.rewrite_manifests()
tbl.refresh()
manifests = tbl.inspect.all_manifests().to_pylist()
assert len(manifests) == 1, "Should have 1 manifests before rewrite"