Fokko commented on code in PR #3743:
URL: https://github.com/apache/iceberg-python/pull/3743#discussion_r4654508000
##########
tests/table/test_snapshots.py:
##########
@@ -706,53 +659,31 @@ def summary_calls(n_files: int) -> int:
)
[email protected]
-def overwrite_table(catalog: Catalog, arrow_table_simple: pa.Table) -> Table:
- catalog.create_namespace("default")
- table = catalog.create_table("default.overwrite",
arrow_table_simple.schema)
- table.append(arrow_table_simple)
- return table
+def test_append_snapshot_producer_defaults_to_merge_append(table_v2: Table) ->
None:
+ from pyiceberg.table.update.snapshot import _MergeAppendFiles
+ append = table_v2.transaction()._append_snapshot_producer({})
-def test_snapshot_writes_include_engine_metadata(
- enable_environment_context: None, catalog: Catalog, arrow_table_simple:
pa.Table
-) -> None:
- catalog.create_namespace("default")
- table = catalog.create_table("default.engine_metadata",
arrow_table_simple.schema)
- table.append(arrow_table_simple)
- table.overwrite(arrow_table_simple)
- table.delete()
+ assert type(append) is _MergeAppendFiles
- table.refresh()
- snapshots = table.snapshots()
- assert snapshots
- for snapshot in snapshots:
- assert snapshot.summary is not None
- assert snapshot.summary["engine-name"] == "pyiceberg"
- assert snapshot.summary["engine-version"] == __version__
+def
test_append_snapshot_producer_uses_fast_append_when_manifest_merge_disabled(table_v2:
Table) -> None:
+ from pyiceberg.table.update.snapshot import _FastAppendFiles
-def test_snapshot_engine_metadata_overrides_snapshot_properties(
- enable_environment_context: None, catalog: Catalog, arrow_table_simple:
pa.Table
-) -> None:
- catalog.create_namespace("default")
- table = catalog.create_table("default.engine_metadata",
arrow_table_simple.schema)
- table.append(
- arrow_table_simple,
- snapshot_properties={
- "engine-name": "custom-engine",
- "engine-version": "custom-version",
- "job-id": "snapshot-job",
- },
- )
+ transaction = table_v2.transaction()
+ transaction.set_properties({"commit.manifest-merge.enabled": "false"})
- table.refresh()
- snapshot = table.current_snapshot()
- assert snapshot is not None
- assert snapshot.summary is not None
- assert snapshot.summary["engine-name"] == "pyiceberg"
- assert snapshot.summary["engine-version"] == __version__
- assert snapshot.summary["job-id"] == "snapshot-job"
+ append = transaction._append_snapshot_producer({})
+
+ assert type(append) is _FastAppendFiles
+
+
Review Comment:
```suggestion
assert type(append) is _FastAppendFiles
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]