Skip to content

Commit 99021cc

Browse files
author
Sreesh Maheshwar
committed
Nit improvements to tests
1 parent 08ad36f commit 99021cc

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

dev/provision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@
457457
)
458458

459459
# https://github.com/apache/iceberg/issues/1092#issuecomment-638432848 / https://github.com/apache/iceberg/issues/3747#issuecomment-1145419407
460-
# REPLACE TABLE requires certain Hive server configuration
460+
# Don't do replace for Hive catalog as REPLACE TABLE requires certain Hive server configuration
461461
if catalog_name != "hive":
462462
# Replace to break snapshot lineage:
463463
spark.sql(

tests/integration/test_reads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ def test_incremental_append_scan_throws_on_missing_snapshot_ids(catalog: Catalog
11591159
test_table.incremental_append_scan(
11601160
to_snapshot_id_inclusive=test_table.snapshots()[0].snapshot_id,
11611161
).plan_files()
1162-
assert "Start snapshot of append scan unspecified, please set from_snapshot_id" in str(e.value)
1162+
assert "Start snapshot of append scan unspecified, please set from_snapshot_id_exclusive" in str(e.value)
11631163

11641164
# from_snapshot_id missing from metadata
11651165
with pytest.raises(ValueError) as e:

tests/table/test_snapshots.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -439,34 +439,33 @@ def test_ancestors_between(table_v2_with_extensive_snapshots: Table) -> None:
439439

440440

441441
def test_is_ancestor_of(table_v2: Table) -> None:
442-
snapshot_id = 3055729675574597004
443-
ancestor_snapshot_id = 3051729675574597004
442+
snapshot_id, ancestor_snapshot_id = 3055729675574597004, 3051729675574597004
444443

445444
assert is_ancestor_of(snapshot_id, ancestor_snapshot_id, table_v2.metadata)
446445
assert not is_ancestor_of(ancestor_snapshot_id, snapshot_id, table_v2.metadata)
447446

448447

449448
def test_ancestors_between_ids(table_v2: Table) -> None:
450-
snapshot_id = 3055729675574597004
451-
ancestor_snapshot_id = 3051729675574597004
449+
snapshot_id, ancestor_snapshot_id = 3055729675574597004, 3051729675574597004
452450

453451
result = list(ancestors_between_ids(ancestor_snapshot_id, snapshot_id, table_v2.metadata))
454452
ids = [ancestor.snapshot_id for ancestor in result]
455453

456-
# Exclusive-inclusive semantics mean just snapshot_id should be returned
454+
# Exclusive-inclusive semantics means just 'snapshot_id' should be returned
457455
assert ids == [snapshot_id]
458456

459457

460458
def test_ancestors_between_equal_ids(table_v2: Table) -> None:
461459
snapshot_id = 3055729675574597004
462460

463461
result = list(ancestors_between_ids(snapshot_id, snapshot_id, table_v2.metadata))
462+
463+
# Exclusive-inclusive semantics mean no ancestors should be returned
464464
assert result == []
465465

466466

467467
def test_ancestors_between_ids_missing_from_snapshot(table_v2: Table) -> None:
468-
snapshot_id = 3055729675574597004
469-
ancestor_snapshot_id = 3051729675574597004
468+
snapshot_id, ancestor_snapshot_id = 3055729675574597004, 3051729675574597004
470469

471470
result = list(
472471
ancestors_between_ids(

0 commit comments

Comments
 (0)