diff --git a/parsl/dataflow/futures.py b/parsl/dataflow/futures.py index d695eb5643..616a3d3bad 100644 --- a/parsl/dataflow/futures.py +++ b/parsl/dataflow/futures.py @@ -6,8 +6,8 @@ from typing import Any, Optional, Sequence, Union import parsl.app.app as app -import parsl.dataflow.taskrecord as tr from parsl.app.futures import DataFuture +from parsl.dataflow.taskrecord import TaskRecord logger = logging.getLogger(__name__) @@ -54,7 +54,7 @@ class AppFuture(Future): """ - def __init__(self, task_record: tr.TaskRecord) -> None: + def __init__(self, task_record: TaskRecord) -> None: """Initialize the AppFuture. Args: diff --git a/parsl/dataflow/taskrecord.py b/parsl/dataflow/taskrecord.py index 00ca43fdb7..0621ab8f41 100644 --- a/parsl/dataflow/taskrecord.py +++ b/parsl/dataflow/taskrecord.py @@ -3,12 +3,16 @@ import datetime import threading from concurrent.futures import Future -from typing import Any, Callable, Dict, List, Optional, Sequence, Union + +# only for type checking: +from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Sequence, Union from typing_extensions import TypedDict +if TYPE_CHECKING: + from parsl.dataflow.futures import AppFuture + import parsl.dataflow.dflow as dflow -import parsl.dataflow.futures as pdf from parsl.dataflow.states import States @@ -25,7 +29,7 @@ class TaskRecord(TypedDict, total=False): depends: List[Future] - app_fu: pdf.AppFuture + app_fu: AppFuture """The Future which was returned to the user when an app was invoked. """