Skip to content

Commit

Permalink
Use PEP563 to cope with circular imports for type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford committed Jul 20, 2023
1 parent 1e8856e commit 90a68cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions parsl/dataflow/job_error_handler.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
from __future__ import annotations

from typing import List, Dict

from parsl.dataflow.job_status_poller import PollItem
import parsl.dataflow.job_status_poller as jsp
# from parsl.dataflow.job_status_poller import PollItem
from parsl.executors.base import ParslExecutor
from parsl.providers.base import JobStatus, JobState


class JobErrorHandler:
def run(self, status: List[PollItem]):
def run(self, status: List[jsp.PollItem]):
for es in status:
self._check_irrecoverable_executor(es)

def _check_irrecoverable_executor(self, es: PollItem):
def _check_irrecoverable_executor(self, es: jsp.PollItem):
if not es.executor.error_management_enabled:
return
es.executor.handle_errors(self, es.status)
Expand Down
6 changes: 4 additions & 2 deletions parsl/dataflow/strategy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from __future__ import annotations
import logging
import time
import math
import warnings
from typing import Dict, List, Optional

from parsl.dataflow.job_status_poller import PollItem
# from parsl.dataflow.job_status_poller import PollItem
import parsl.dataflow.job_status_poller as jsp
from parsl.executors import HighThroughputExecutor
from parsl.executors.base import ParslExecutor
from parsl.executors.status_handling import BlockProviderExecutor
Expand Down Expand Up @@ -134,7 +136,7 @@ def add_executors(self, executors):
for executor in executors:
self.executors[executor.label] = {'idle_since': None}

def _strategy_noop(self, status: List[PollItem]) -> None:
def _strategy_noop(self, status: List[jsp.PollItem]) -> None:
"""Do nothing.
"""
logger.debug("strategy_noop: doing nothing")
Expand Down

0 comments on commit 90a68cc

Please sign in to comment.