Skip to content

Commit

Permalink
Better annotation for InMemoryJournalWriter's value_sanitizer
Browse files Browse the repository at this point in the history
make it consistent with the KafkaJournalWriter.
  • Loading branch information
douardda committed Jun 18, 2021
1 parent 8358298 commit a4ae96d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions swh/journal/writer/inmemory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import logging
from multiprocessing import Manager
from typing import Any, Generic, List, Tuple, TypeVar
from typing import Any, Callable, Dict, Generic, List, Tuple, TypeVar

from . import ValueProtocol

Expand All @@ -19,7 +19,9 @@ class InMemoryJournalWriter(Generic[TValue]):
objects: List[Tuple[str, TValue]]
privileged_objects: List[Tuple[str, TValue]]

def __init__(self, value_sanitizer: Any):
def __init__(
self, value_sanitizer: Callable[[str, Dict[str, Any]], Dict[str, Any]]
):
# Share the list of objects across processes, for RemoteAPI tests.
self.manager = Manager()
self.objects = self.manager.list()
Expand Down

0 comments on commit a4ae96d

Please sign in to comment.