File tree Expand file tree Collapse file tree 2 files changed +8
-18
lines changed Expand file tree Collapse file tree 2 files changed +8
-18
lines changed Original file line number Diff line number Diff line change 68
68
RemoveSnapshotRefUpdate ,
69
69
RemoveSnapshotsUpdate ,
70
70
SetSnapshotRefUpdate ,
71
- TableRequirement ,
72
71
TableMetadata ,
72
+ TableRequirement ,
73
73
TableUpdate ,
74
74
U ,
75
75
UpdatesAndRequirements ,
76
76
UpdateTableMetadata ,
77
77
)
78
-
79
78
from pyiceberg .typedef import (
80
79
EMPTY_DICT ,
81
80
KeyDefaultDict ,
85
84
from pyiceberg .utils .properties import property_as_bool , property_as_int
86
85
87
86
if TYPE_CHECKING :
88
- from pyiceberg . table import Table
87
+ pass
89
88
90
- from pyiceberg .table .metadata import Snapshot
91
- from pyiceberg .table .update import UpdateTableMetadata
92
- from typing import Optional , Set
93
- from datetime import datetime , timezone
94
89
95
- from typing import Dict , Optional , Set
96
- import uuid
97
- from pyiceberg .table .metadata import TableMetadata
90
+ from pyiceberg .table .metadata import Snapshot , TableMetadata
98
91
from pyiceberg .table .snapshots import Snapshot
99
- from pyiceberg .table .update import (
100
- UpdateTableMetadata ,
101
- RemoveSnapshotsUpdate ,
102
- UpdatesAndRequirements ,
103
- AssertRefSnapshotId ,
104
- )
92
+
105
93
106
94
def _new_manifest_file_name (num : int , commit_uuid : uuid .UUID ) -> str :
107
95
return f"{ commit_uuid } -m{ num } .avro"
Original file line number Diff line number Diff line change
1
+ from unittest .mock import MagicMock
1
2
from uuid import uuid4
3
+
2
4
from pyiceberg .table import CommitTableResponse , Table
3
- from unittest . mock import MagicMock
5
+
4
6
5
7
def test_expire_snapshot (table_v2 : Table ) -> None :
6
8
EXPIRE_SNAPSHOT = 3051729675574597004
@@ -10,7 +12,7 @@ def test_expire_snapshot(table_v2: Table) -> None:
10
12
# Use the table's current metadata but keep only the snapshot not to be expired
11
13
metadata = table_v2 .metadata .model_copy (update = {"snapshots" : [KEEP_SNAPSHOT ]}),
12
14
metadata_location = "mock://metadata/location" ,
13
- uuid = uuid4 ()
15
+ uuid = uuid4 (),
14
16
)
15
17
16
18
# Mock the commit_table method to return the mock response
You can’t perform that action at this time.
0 commit comments