From 8ebc24bcfa6c7e2fe1c9b8d2f10a8be61ff31a13 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Tue, 10 Mar 2026 07:22:22 -0700 Subject: [PATCH] Fix: update paperless_text signal shim to import from new parser location paperless_text/parsers.py was moved to paperless/parsers/text.py as part of the Phase 3 parser migration. Update the signal-based get_parser() factory to import from the new location and strip the legacy logging_group / progress_callback kwargs that the new TextDocumentParser no longer accepts. This shim keeps document consumption functional until Phase 4 replaces the signal path with the new ParserRegistry. Co-Authored-By: Claude Sonnet 4.6 --- src/paperless_text/signals.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/paperless_text/signals.py b/src/paperless_text/signals.py index 05804c6d6..cf74d1c0e 100644 --- a/src/paperless_text/signals.py +++ b/src/paperless_text/signals.py @@ -1,7 +1,13 @@ def get_parser(*args, **kwargs): - from paperless_text.parsers import TextDocumentParser + from paperless.parsers.text import TextDocumentParser - return TextDocumentParser(*args, **kwargs) + # 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) + kwargs.pop("progress_callback", None) + return TextDocumentParser() def text_consumer_declaration(sender, **kwargs):