Skip to content

Commit 39c56f6

Browse files
committed
use LRU cache
1 parent 3a5846d commit 39c56f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyiceberg/table/snapshots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from enum import Enum
2222
from typing import TYPE_CHECKING, Any, DefaultDict, Dict, Iterable, List, Mapping, Optional
2323

24-
from cachetools import cached
24+
from cachetools import LRUCache, cached
2525
from cachetools.keys import hashkey
2626
from pydantic import Field, PrivateAttr, model_serializer
2727

@@ -232,7 +232,7 @@ def __eq__(self, other: Any) -> bool:
232232
)
233233

234234

235-
@cached(cache={}, key=lambda io, manifest_list: hashkey(manifest_list))
235+
@cached(cache=LRUCache(maxsize=128), key=lambda io, manifest_list: hashkey(manifest_list))
236236
def _manifests(io: FileIO, manifest_list: str) -> List[ManifestFile]:
237237
"""Return the manifests from the manifest list."""
238238
file = io.new_input(manifest_list)

0 commit comments

Comments
 (0)