1919import time
2020from collections import defaultdict
2121from enum import Enum
22- from functools import lru_cache
2322from typing import TYPE_CHECKING , Any , DefaultDict , Dict , Iterable , List , Mapping , Optional
2423
2524from pydantic import Field , PrivateAttr , model_serializer
2625
2726from pyiceberg .io import FileIO
28- from pyiceberg .manifest import DataFile , DataFileContent , ManifestFile , read_manifest_list
27+ from pyiceberg .manifest import DataFile , DataFileContent , ManifestFile , _manifests
2928from pyiceberg .partitioning import UNPARTITIONED_PARTITION_SPEC , PartitionSpec
3029from pyiceberg .schema import Schema
3130
@@ -231,13 +230,6 @@ def __eq__(self, other: Any) -> bool:
231230 )
232231
233232
234- @lru_cache
235- def _manifests (io : FileIO , manifest_list : str ) -> List [ManifestFile ]:
236- """Return the manifests from the manifest list."""
237- file = io .new_input (manifest_list )
238- return list (read_manifest_list (file ))
239-
240-
241233class Snapshot (IcebergBaseModel ):
242234 snapshot_id : int = Field (alias = "snapshot-id" )
243235 parent_snapshot_id : Optional [int ] = Field (alias = "parent-snapshot-id" , default = None )
@@ -260,7 +252,7 @@ def __str__(self) -> str:
260252 def manifests (self , io : FileIO ) -> List [ManifestFile ]:
261253 """Return the manifests for the given snapshot."""
262254 if self .manifest_list :
263- return _manifests (io , self .manifest_list )
255+ return list ( _manifests (io , self .manifest_list ) )
264256 return []
265257
266258
0 commit comments