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 @@ -1314,11 +1314,11 @@ else: return None - def clear_buffers(self, object_types: Sequence[str]) -> None: + def clear_buffers(self, object_types: Sequence[str] = ()) -> None: """Do nothing """ return None - def flush(self, object_types: Sequence[str]) -> Dict[str, int]: + def flush(self, object_types: Sequence[str] = ()) -> Dict[str, int]: return {} diff --git a/swh/storage/interface.py b/swh/storage/interface.py --- a/swh/storage/interface.py +++ b/swh/storage/interface.py @@ -1185,7 +1185,7 @@ ... @remote_api_endpoint("clear/buffer") - def clear_buffers(self, object_types: Sequence[str]) -> None: + def clear_buffers(self, object_types: Sequence[str] = ()) -> None: """For backend storages (pg, storage, in-memory), this is a noop operation. For proxy storages (especially filter, buffer), this is an operation which cleans internal state. @@ -1193,7 +1193,7 @@ """ @remote_api_endpoint("flush") - def flush(self, object_types: Sequence[str]) -> Dict[str, int]: + def flush(self, object_types: Sequence[str] = ()) -> Dict[str, int]: """For backend storages (pg, storage, in-memory), this is expected to be a noop operation. For proxy storages (especially buffer), this is expected to trigger actual writes to the backend. diff --git a/swh/storage/postgresql/storage.py b/swh/storage/postgresql/storage.py --- a/swh/storage/postgresql/storage.py +++ b/swh/storage/postgresql/storage.py @@ -1396,13 +1396,13 @@ return None return MetadataAuthority.from_dict(dict(zip(db.metadata_authority_cols, row))) - def clear_buffers(self, object_types: Sequence[str]) -> None: + def clear_buffers(self, object_types: Sequence[str] = ()) -> None: """Do nothing """ return None - def flush(self, object_types: Sequence[str]) -> Dict[str, int]: + def flush(self, object_types: Sequence[str] = ()) -> Dict[str, int]: return {} def _get_authority_id(self, authority: MetadataAuthority, db, cur): diff --git a/swh/storage/tests/test_postgresql.py b/swh/storage/tests/test_postgresql.py --- a/swh/storage/tests/test_postgresql.py +++ b/swh/storage/tests/test_postgresql.py @@ -248,13 +248,13 @@ """Calling clear buffers on real storage does nothing """ - assert swh_storage.clear_buffers([]) is None + assert swh_storage.clear_buffers() is None def test_flush(self, swh_storage): """Calling clear buffers on real storage does nothing """ - assert swh_storage.flush([]) == {} + assert swh_storage.flush() == {} def test_dbversion(self, swh_storage): with swh_storage.db() as db: