From 9e2935cd2ed34eac2a0ea133c07483c4c0e39fc7 Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Wed, 17 Jul 2024 09:51:04 +0000 Subject: [PATCH] mypy does not typecheck this call, so do it with typeguard at runtime... (and of course it fails...) --- parsl/monitoring/db_manager.py | 3 +++ parsl/monitoring/router.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/parsl/monitoring/db_manager.py b/parsl/monitoring/db_manager.py index 9f19cd9f4d..bb71119bee 100644 --- a/parsl/monitoring/db_manager.py +++ b/parsl/monitoring/db_manager.py @@ -6,6 +6,8 @@ import time from typing import Any, Dict, List, Optional, Set, Tuple, TypeVar, cast +import typeguard + from parsl.dataflow.states import States from parsl.errors import OptionalModuleMissing from parsl.log_utils import set_file_logger @@ -719,6 +721,7 @@ def close(self) -> None: @wrap_with_logs(target="database_manager") +@typeguard.typechecked def dbm_starter(exception_q: "queue.Queue[Tuple[str, str]]", priority_msgs: "queue.Queue[TaggedMonitoringMessage]", node_msgs: "queue.Queue[MonitoringMessage]", diff --git a/parsl/monitoring/router.py b/parsl/monitoring/router.py index 4be454b797..02772a2fa7 100644 --- a/parsl/monitoring/router.py +++ b/parsl/monitoring/router.py @@ -10,6 +10,7 @@ from multiprocessing.synchronize import Event from typing import Optional, Tuple, Union +import typeguard import zmq from parsl.log_utils import set_file_logger @@ -202,6 +203,7 @@ def start_zmq_listener(self) -> None: @wrap_with_logs +@typeguard.typechecked def router_starter(comm_q: "queue.Queue[Union[Tuple[int, int], str]]", exception_q: "queue.Queue[Tuple[str, str]]", priority_msgs: "queue.Queue[AddressedMonitoringMessage]",