Skip to content

Commit

Permalink
return tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjqliu committed Sep 20, 2024
1 parent 14e7f38 commit eaeb924
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pyiceberg/table/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import time
from collections import defaultdict
from enum import Enum
from typing import TYPE_CHECKING, Any, DefaultDict, Dict, Iterable, List, Mapping, Optional
from typing import TYPE_CHECKING, Any, DefaultDict, Dict, Iterable, List, Mapping, Optional, Tuple

from cachetools import LRUCache, cached
from cachetools.keys import hashkey
Expand Down Expand Up @@ -233,10 +233,10 @@ def __eq__(self, other: Any) -> bool:


@cached(cache=LRUCache(maxsize=128), key=lambda io, manifest_list: hashkey(manifest_list))
def _manifests(io: FileIO, manifest_list: str) -> List[ManifestFile]:
"""Return the manifests from the manifest list."""
def _manifests(io: FileIO, manifest_list: str) -> Tuple[ManifestFile, ...]:
"""Read and cache manifests from the given manifest list, returning a tuple to prevent modification."""
file = io.new_input(manifest_list)
return list(read_manifest_list(file))
return tuple(read_manifest_list(file))


class Snapshot(IcebergBaseModel):
Expand All @@ -261,7 +261,7 @@ def __str__(self) -> str:
def manifests(self, io: FileIO) -> List[ManifestFile]:
"""Return the manifests for the given snapshot."""
if self.manifest_list:
return _manifests(io, self.manifest_list)
return list(_manifests(io, self.manifest_list))
return []


Expand Down

0 comments on commit eaeb924

Please sign in to comment.