Skip to content

Commit

Permalink
mypy does not typecheck this call, so do it with typeguard at runtime...
Browse files Browse the repository at this point in the history
(and of course it fails...)
  • Loading branch information
benclifford committed Aug 8, 2024
1 parent 1c7a0e4 commit 9e2935c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions parsl/monitoring/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]",
Expand Down
2 changes: 2 additions & 0 deletions parsl/monitoring/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]",
Expand Down

0 comments on commit 9e2935c

Please sign in to comment.