From d8937ad916c0f95b3d43b608706ade42a72f0747 Mon Sep 17 00:00:00 2001 From: Pier-Jean Malandrino Date: Fri, 10 Apr 2026 14:37:51 +0200 Subject: [PATCH] fix: remove dead store and no-effect await flagged by CodeQL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - local_converter.py: remove redundant `_default_converter = None` in except block of `_ensure_default_converter` (variable was already None, re-raised immediately — dead store) - test_analysis_service.py: replace bare `await task` with `await asyncio.gather(task)` to satisfy static analysis --- document-parser/infra/local_converter.py | 1 - document-parser/tests/test_analysis_service.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/document-parser/infra/local_converter.py b/document-parser/infra/local_converter.py index cb9db78..d7865b9 100644 --- a/document-parser/infra/local_converter.py +++ b/document-parser/infra/local_converter.py @@ -120,7 +120,6 @@ def _ensure_default_converter() -> DoclingConverter: try: _default_converter = _build_docling_converter(ConversionOptions()) except Exception: - _default_converter = None raise return _default_converter diff --git a/document-parser/tests/test_analysis_service.py b/document-parser/tests/test_analysis_service.py index a33db28..f48f4cf 100644 --- a/document-parser/tests/test_analysis_service.py +++ b/document-parser/tests/test_analysis_service.py @@ -152,7 +152,7 @@ class TestAnalysisServiceCancellation: task = asyncio.create_task(instant()) service._running_tasks["j1"] = task task.add_done_callback(functools.partial(service._on_task_done, job_id="j1")) - await task + await asyncio.gather(task) assert "j1" not in service._running_tasks