diff --git a/src/paperless_text/signals.py b/src/paperless_text/signals.py index cf74d1c0e..c2c337b3b 100644 --- a/src/paperless_text/signals.py +++ b/src/paperless_text/signals.py @@ -1,16 +1,20 @@ -def get_parser(*args, **kwargs): +from __future__ import annotations + +from typing import Any + + +def get_parser(*args: Any, **kwargs: Any) -> Any: from paperless.parsers.text import TextDocumentParser - # The new TextDocumentParser does not accept the legacy logging_group / - # progress_callback kwargs injected by the old signal-based consumer. - # These are dropped here; Phase 4 will replace this signal path with the - # new ParserRegistry so the shim can be removed at that point. - kwargs.pop("logging_group", None) + # The new TextDocumentParser does not accept the progress_callback + # kwarg injected by the old signal-based consumer. logging_group is + # forwarded as a positional arg. + # Phase 4 will replace this signal path with the new ParserRegistry. kwargs.pop("progress_callback", None) - return TextDocumentParser() + return TextDocumentParser(*args, **kwargs) -def text_consumer_declaration(sender, **kwargs): +def text_consumer_declaration(sender: Any, **kwargs: Any) -> dict[str, Any]: return { "parser": get_parser, "weight": 10,