Skip to content

Commit 82d3f6a

Browse files
refactor: update S3Store to use new serialization adapter pattern
Adapt S3Store to match the serialization refactoring from PR #184: - Replace ManagedEntry.from_json() with self._serialization_adapter.load_json() - Replace managed_entry.to_json() with self._serialization_adapter.dump_json() - Leverage BasicSerializationAdapter automatically initialized by BaseStore Co-authored-by: William Easton <strawgate@users.noreply.github.com>
1 parent 401d947 commit 82d3f6a

File tree

1 file changed

+2
-2
lines changed
  • key-value/key-value-aio/src/key_value/aio/stores/s3

1 file changed

+2
-2
lines changed

key-value/key-value-aio/src/key_value/aio/stores/s3/store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ async def _get_managed_entry(self, *, key: str, collection: str) -> ManagedEntry
257257
json_value = body_bytes.decode("utf-8") # pyright: ignore[reportUnknownMemberType]
258258

259259
# Deserialize to ManagedEntry
260-
managed_entry = ManagedEntry.from_json(json_str=json_value)
260+
managed_entry = self._serialization_adapter.load_json(json_str=json_value)
261261

262262
# Check for client-side expiration
263263
if managed_entry.is_expired:
@@ -291,7 +291,7 @@ async def _put_managed_entry(
291291
managed_entry: The ManagedEntry to store.
292292
"""
293293
s3_key = self._get_s3_key(collection=collection, key=key)
294-
json_value = managed_entry.to_json()
294+
json_value = self._serialization_adapter.dump_json(entry=managed_entry)
295295

296296
# Prepare metadata
297297
metadata: dict[str, str] = {}

0 commit comments

Comments
 (0)