diff --git a/swh/storage/cassandra/storage.py b/swh/storage/cassandra/storage.py --- a/swh/storage/cassandra/storage.py +++ b/swh/storage/cassandra/storage.py @@ -607,7 +607,7 @@ return {"snapshot:add": len(snapshots)} - def snapshot_missing(self, snapshots): + def snapshot_missing(self, snapshots: List[Sha1Git]) -> Iterable[Sha1Git]: return self._cql_runner.snapshot_missing(snapshots) def snapshot_get(self, snapshot_id): diff --git a/swh/storage/in_memory.py b/swh/storage/in_memory.py --- a/swh/storage/in_memory.py +++ b/swh/storage/in_memory.py @@ -608,7 +608,7 @@ return {"snapshot:add": count} - def snapshot_missing(self, snapshots): + def snapshot_missing(self, snapshots: List[Sha1Git]) -> Iterable[Sha1Git]: for id in snapshots: if id not in self._snapshots: yield id diff --git a/swh/storage/interface.py b/swh/storage/interface.py --- a/swh/storage/interface.py +++ b/swh/storage/interface.py @@ -677,11 +677,11 @@ ... @remote_api_endpoint("snapshot/missing") - def snapshot_missing(self, snapshots): + def snapshot_missing(self, snapshots: List[Sha1Git]) -> Iterable[Sha1Git]: """List snapshots missing from storage Args: - snapshots (iterable): an iterable of snapshot ids + snapshots: snapshot ids Yields: missing snapshot ids diff --git a/swh/storage/storage.py b/swh/storage/storage.py --- a/swh/storage/storage.py +++ b/swh/storage/storage.py @@ -742,7 +742,9 @@ @timed @db_transaction_generator() - def snapshot_missing(self, snapshots, db=None, cur=None): + def snapshot_missing( + self, snapshots: List[Sha1Git], db=None, cur=None + ) -> Iterable[Sha1Git]: for obj in db.snapshot_missing_from_list(snapshots, cur): yield obj[0]