Skip to content

Commit ce44d1f

Browse files
authored
Remove unnecessary custom pickling functions (#661)
1 parent 9a6fe6f commit ce44d1f

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

virtualizarr/manifests/store.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from __future__ import annotations
22

3-
import pickle
43
from collections.abc import AsyncGenerator, Iterable, Mapping
54
from dataclasses import dataclass
6-
from typing import TYPE_CHECKING, Any, TypeAlias
5+
from typing import TYPE_CHECKING, TypeAlias
76
from urllib.parse import urlparse
87

98
from zarr.abc.store import (
@@ -237,21 +236,6 @@ def __init__(
237236
def __str__(self) -> str:
238237
return f"ManifestStore(group={self._group}, stores={self._store_registry})"
239238

240-
def __getstate__(self) -> dict[Any, Any]:
241-
state = self.__dict__.copy()
242-
stores = state["_store_registry"]._stores.copy()
243-
for k, v in stores.items():
244-
stores[k] = pickle.dumps(v)
245-
state["_store_registry"] = stores
246-
return state
247-
248-
def __setstate__(self, state: dict[Any, Any]) -> None:
249-
stores = state["_store_registry"].copy()
250-
for k, v in stores.items():
251-
stores[k] = pickle.loads(v)
252-
state["_store_registry"] = ObjectStoreRegistry(stores)
253-
self.__dict__.update(state)
254-
255239
async def get(
256240
self,
257241
key: str,

0 commit comments

Comments
 (0)