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 @@ -755,7 +755,9 @@ assert len(origins) <= limit return PagedResult(results=origins, next_page_token=next_page_token) - def origin_count(self, url_pattern, regexp=False, with_visit=False): + def origin_count( + self, url_pattern: str, regexp: bool = False, with_visit: bool = False + ) -> int: actual_page = self.origin_search( url_pattern, regexp=regexp, with_visit=with_visit, limit=len(self._origins), ) diff --git a/swh/storage/interface.py b/swh/storage/interface.py --- a/swh/storage/interface.py +++ b/swh/storage/interface.py @@ -1067,7 +1067,9 @@ @deprecated @remote_api_endpoint("origin/count") - def origin_count(self, url_pattern, regexp=False, with_visit=False): + def origin_count( + self, url_pattern: str, regexp: bool = False, with_visit: bool = False + ) -> int: """Count origins whose urls contain a provided string pattern or match a provided regular expression. The pattern search in origin urls is performed in a case insensitive diff --git a/swh/storage/storage.py b/swh/storage/storage.py --- a/swh/storage/storage.py +++ b/swh/storage/storage.py @@ -1142,8 +1142,13 @@ @timed @db_transaction() def origin_count( - self, url_pattern, regexp=False, with_visit=False, db=None, cur=None - ): + self, + url_pattern: str, + regexp: bool = False, + with_visit: bool = False, + db=None, + cur=None, + ) -> int: return db.origin_count(url_pattern, regexp, with_visit, cur) @timed