Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,8 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install poetry
run: make install-poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: poetry
cache-dependency-path: ./poetry.lock
- name: Install
run: make install-dependencies
run: make install
- name: Linters
run: make lint
- name: Tests
Expand Down
14 changes: 11 additions & 3 deletions pyiceberg/table/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import time
from collections import defaultdict
from enum import Enum
from functools import lru_cache
from typing import TYPE_CHECKING, Any, DefaultDict, Dict, Iterable, List, Mapping, Optional

from pydantic import Field, PrivateAttr, model_serializer
Expand Down Expand Up @@ -228,6 +229,13 @@ def __eq__(self, other: Any) -> bool:
)


@lru_cache
def _manifests(io: FileIO, manifest_list: str) -> List[ManifestFile]:
"""Return the manifests from the manifest list."""
file = io.new_input(manifest_list)
return list(read_manifest_list(file))


class Snapshot(IcebergBaseModel):
snapshot_id: int = Field(alias="snapshot-id")
parent_snapshot_id: Optional[int] = Field(alias="parent-snapshot-id", default=None)
Expand All @@ -248,9 +256,9 @@ def __str__(self) -> str:
return result_str

def manifests(self, io: FileIO) -> List[ManifestFile]:
if self.manifest_list is not None:
file = io.new_input(self.manifest_list)
return list(read_manifest_list(file))
"""Return the manifests for the given snapshot."""
if self.manifest_list:
return _manifests(io, self.manifest_list)
return []


Expand Down