From 8ac000b4e1cf7b2e4ec0484e5fa738817fd0b4f1 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed, 22 Jun 2022 11:16:57 +0200 Subject: [PATCH] cache: Don't return objstorage.add's return value, and add types objstorage.add() will change/remove its return value in a future version, and we do not use it in the vault anyway. --- swh/vault/cache.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swh/vault/cache.py b/swh/vault/cache.py index 5717d40..bd88b9f 100644 --- a/swh/vault/cache.py +++ b/swh/vault/cache.py @@ -19,11 +19,11 @@ class VaultCache: def __init__(self, **objstorage): self.objstorage = get_objstorage(**objstorage) - def add(self, bundle_type, swhid: CoreSWHID, content): + def add(self, bundle_type, swhid: CoreSWHID, content) -> None: sid = self._get_internal_id(bundle_type, swhid) - return self.objstorage.add(content, sid) + self.objstorage.add(content, sid) - def get(self, bundle_type, swhid: CoreSWHID): + def get(self, bundle_type, swhid: CoreSWHID) -> bytes: sid = self._get_internal_id(bundle_type, swhid) return self.objstorage.get(hashutil.hash_to_bytes(sid)) @@ -31,7 +31,7 @@ class VaultCache: sid = self._get_internal_id(bundle_type, swhid) return self.objstorage.delete(hashutil.hash_to_bytes(sid)) - def is_cached(self, bundle_type, swhid: CoreSWHID): + def is_cached(self, bundle_type, swhid: CoreSWHID) -> bool: sid = self._get_internal_id(bundle_type, swhid) return hashutil.hash_to_bytes(sid) in self.objstorage -- GitLab