This is an automated email from the ASF dual-hosted git repository.
fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
The following commit(s) were added to refs/heads/main by this push:
new dbe2486f Add lock for `cachetools` (#2555)
dbe2486f is described below
commit dbe2486f49ddbcb06685404ead0c6ca90aa0bfcd
Author: Gowthami B <[email protected]>
AuthorDate: Thu Oct 2 15:11:07 2025 -0400
Add lock for `cachetools` (#2555)
<!--
Thanks for opening a pull request!
-->
<!-- In the case this PR will resolve an issue, please replace
${GITHUB_ISSUE_ID} below with the actual Github issue id. -->
<!-- Closes #${GITHUB_ISSUE_ID} -->
# Rationale for this change
Fixes #1905
## Are these changes tested?
## Are there any user-facing changes?
<!-- In the case of user-facing changes, please add the changelog label.
-->
---
pyiceberg/manifest.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyiceberg/manifest.py b/pyiceberg/manifest.py
index 470c99d6..eafb2b7c 100644
--- a/pyiceberg/manifest.py
+++ b/pyiceberg/manifest.py
@@ -17,6 +17,7 @@
from __future__ import annotations
import math
+import threading
from abc import ABC, abstractmethod
from copy import copy
from enum import Enum
@@ -875,7 +876,7 @@ class ManifestFile(Record):
return hash(self.manifest_path)
-@cached(cache=LRUCache(maxsize=128), key=lambda io, manifest_list:
hashkey(manifest_list))
+@cached(cache=LRUCache(maxsize=128), key=lambda io, manifest_list:
hashkey(manifest_list), lock=threading.RLock())
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)