Skip to content

Commit 9185389

Browse files
authored
Make validation_history private before release (apache#2054)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change `validation_history` is a helper function that will be used for checking for newly added manifests. Hence it would make sense to make this function private before it is released. # Are these changes tested? Yes, integration tests and unit tests. # Are there any user-facing changes? This function has yet to be released
1 parent e6d91c3 commit 9185389

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pyiceberg/table/update/validate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
VALIDATE_DATA_FILES_EXIST_OPERATIONS = {Operation.OVERWRITE, Operation.REPLACE, Operation.DELETE}
2828

2929

30-
def validation_history(
30+
def _validation_history(
3131
table: Table,
3232
from_snapshot: Snapshot,
3333
to_snapshot: Snapshot,
@@ -100,7 +100,7 @@ def _deleted_data_files(
100100
if parent_snapshot is None:
101101
return
102102

103-
manifests, snapshot_ids = validation_history(
103+
manifests, snapshot_ids = _validation_history(
104104
table,
105105
parent_snapshot,
106106
starting_snapshot,

tests/table/test_validate.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from pyiceberg.manifest import ManifestContent, ManifestEntry, ManifestEntryStatus, ManifestFile
2626
from pyiceberg.table import Table
2727
from pyiceberg.table.snapshots import Operation, Snapshot, Summary
28-
from pyiceberg.table.update.validate import _deleted_data_files, _validate_deleted_data_files, validation_history
28+
from pyiceberg.table.update.validate import _deleted_data_files, _validate_deleted_data_files, _validation_history
2929

3030

3131
@pytest.fixture
@@ -69,7 +69,7 @@ def mock_read_manifest_side_effect(self: Snapshot, io: FileIO) -> list[ManifestF
6969
return []
7070

7171
with patch("pyiceberg.table.snapshots.Snapshot.manifests", new=mock_read_manifest_side_effect):
72-
manifests, snapshots = validation_history(
72+
manifests, snapshots = _validation_history(
7373
table,
7474
oldest_snapshot,
7575
newest_snapshot,
@@ -99,7 +99,7 @@ def test_validation_history_fails_on_snapshot_with_no_summary(
9999
)
100100
with patch("pyiceberg.table.update.validate.ancestors_between", return_value=[snapshot_with_no_summary]):
101101
with pytest.raises(ValidationException):
102-
validation_history(
102+
_validation_history(
103103
table,
104104
oldest_snapshot,
105105
newest_snapshot,
@@ -129,7 +129,7 @@ def mock_read_manifest_side_effect(self: Snapshot, io: FileIO) -> list[ManifestF
129129
with patch("pyiceberg.table.snapshots.Snapshot.manifests", new=mock_read_manifest_side_effect):
130130
with patch("pyiceberg.table.update.validate.ancestors_between", return_value=missing_oldest_snapshot):
131131
with pytest.raises(ValidationException):
132-
validation_history(
132+
_validation_history(
133133
table,
134134
oldest_snapshot,
135135
newest_snapshot,

0 commit comments

Comments
 (0)