|
30 | 30 | normalize_cache_fields, |
31 | 31 | normalize_cache_instruments, |
32 | 32 | ) |
| 33 | +from ..utils.pickle_utils import restricted_pickle_load |
33 | 34 |
|
34 | 35 | from ..log import get_module_logger |
35 | 36 | from .base import Feature |
@@ -225,7 +226,7 @@ def visit(cache_path: Union[str, Path]): |
225 | 226 | cache_path = Path(cache_path) |
226 | 227 | meta_path = cache_path.with_suffix(".meta") |
227 | 228 | with meta_path.open("rb") as f: |
228 | | - d = pickle.load(f) |
| 229 | + d = restricted_pickle_load(f) |
229 | 230 | with meta_path.open("wb") as f: |
230 | 231 | try: |
231 | 232 | d["meta"]["last_visit"] = str(time.time()) |
@@ -592,7 +593,7 @@ def update(self, sid, cache_uri, freq: str = "day"): |
592 | 593 |
|
593 | 594 | with CacheUtils.writer_lock(self.r, f"{str(C.dpm.get_data_uri())}:expression-{cache_uri}"): |
594 | 595 | with meta_path.open("rb") as f: |
595 | | - d = pickle.load(f) |
| 596 | + d = restricted_pickle_load(f) |
596 | 597 | instrument = d["info"]["instrument"] |
597 | 598 | field = d["info"]["field"] |
598 | 599 | freq = d["info"]["freq"] |
@@ -959,7 +960,7 @@ def update(self, cache_uri, freq: str = "day"): |
959 | 960 | im = DiskDatasetCache.IndexManager(cp_cache_uri) |
960 | 961 | with CacheUtils.writer_lock(self.r, f"{str(C.dpm.get_data_uri())}:dataset-{cache_uri}"): |
961 | 962 | with meta_path.open("rb") as f: |
962 | | - d = pickle.load(f) |
| 963 | + d = restricted_pickle_load(f) |
963 | 964 | instruments = d["info"]["instruments"] |
964 | 965 | fields = d["info"]["fields"] |
965 | 966 | freq = d["info"]["freq"] |
|
0 commit comments