Skip to content

Commit 1af3258

Browse files
committed
Fixed format and linting issues
Re-ran the `poetry run pre-commit run --all-files` command on the project.
1 parent d30a08c commit 1af3258

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

pyiceberg/table/update/snapshot.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,13 @@
6868
RemoveSnapshotRefUpdate,
6969
RemoveSnapshotsUpdate,
7070
SetSnapshotRefUpdate,
71-
TableRequirement,
7271
TableMetadata,
72+
TableRequirement,
7373
TableUpdate,
7474
U,
7575
UpdatesAndRequirements,
7676
UpdateTableMetadata,
7777
)
78-
7978
from pyiceberg.typedef import (
8079
EMPTY_DICT,
8180
KeyDefaultDict,
@@ -85,23 +84,12 @@
8584
from pyiceberg.utils.properties import property_as_bool, property_as_int
8685

8786
if TYPE_CHECKING:
88-
from pyiceberg.table import Table
87+
pass
8988

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
9489

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
9891
from pyiceberg.table.snapshots import Snapshot
99-
from pyiceberg.table.update import (
100-
UpdateTableMetadata,
101-
RemoveSnapshotsUpdate,
102-
UpdatesAndRequirements,
103-
AssertRefSnapshotId,
104-
)
92+
10593

10694
def _new_manifest_file_name(num: int, commit_uuid: uuid.UUID) -> str:
10795
return f"{commit_uuid}-m{num}.avro"

tests/table/test_expire_snapshots.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
from unittest.mock import MagicMock
12
from uuid import uuid4
3+
24
from pyiceberg.table import CommitTableResponse, Table
3-
from unittest.mock import MagicMock
5+
46

57
def test_expire_snapshot(table_v2: Table) -> None:
68
EXPIRE_SNAPSHOT = 3051729675574597004
@@ -10,7 +12,7 @@ def test_expire_snapshot(table_v2: Table) -> None:
1012
# Use the table's current metadata but keep only the snapshot not to be expired
1113
metadata=table_v2.metadata.model_copy(update={"snapshots": [KEEP_SNAPSHOT]}),
1214
metadata_location="mock://metadata/location",
13-
uuid=uuid4()
15+
uuid=uuid4(),
1416
)
1517

1618
# Mock the commit_table method to return the mock response

0 commit comments

Comments
 (0)