Page MenuHomeSoftware Heritage

D3707.id13069.diff
No OneTemporary

D3707.id13069.diff

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
@@ -462,7 +462,7 @@
return {"revision:add": len(revisions)}
- def revision_missing(self, revisions):
+ def revision_missing(self, revisions: List[Sha1Git]) -> Iterable[Sha1Git]:
return self._cql_runner.revision_missing(revisions)
def revision_get(self, revisions):
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
@@ -522,7 +522,7 @@
return {"revision:add": count}
- def revision_missing(self, revisions):
+ def revision_missing(self, revisions: List[Sha1Git]) -> Iterable[Sha1Git]:
for id in revisions:
if id not in self._revisions:
yield id
diff --git a/swh/storage/interface.py b/swh/storage/interface.py
--- a/swh/storage/interface.py
+++ b/swh/storage/interface.py
@@ -508,11 +508,11 @@
...
@remote_api_endpoint("revision/missing")
- def revision_missing(self, revisions):
+ def revision_missing(self, revisions: List[Sha1Git]) -> Iterable[Sha1Git]:
"""List revisions missing from storage
Args:
- revisions (iterable): revision ids
+ revisions: revision ids
Yields:
missing revision ids
diff --git a/swh/storage/storage.py b/swh/storage/storage.py
--- a/swh/storage/storage.py
+++ b/swh/storage/storage.py
@@ -604,9 +604,11 @@
@timed
@db_transaction_generator()
- def revision_missing(self, revisions, db=None, cur=None):
+ def revision_missing(
+ self, revisions: List[Sha1Git], db=None, cur=None
+ ) -> Iterable[Sha1Git]:
if not revisions:
- return
+ return None
for obj in db.revision_missing_from_list(revisions, cur):
yield obj[0]

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 7:16 PM (18 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3228047

Event Timeline