diff --git a/flytekit/remote/remote.py b/flytekit/remote/remote.py index 6e916448d1..33771eb578 100644 --- a/flytekit/remote/remote.py +++ b/flytekit/remote/remote.py @@ -217,6 +217,10 @@ def _get_pickled_target_dict( raise FlyteAssertion( f"Dynamic tasks are not supported in interactive mode. {entity.name} is a dynamic task." ) + if entity.execution_mode == PythonFunctionTask.ExecutionBehavior.EAGER: + raise FlyteAssertion( + f"Eager tasks are not supported in interactive mode. {entity.name} is an eager task." + ) if isinstance(entity, PythonTask): if isinstance(entity, (PythonAutoContainerTask, ArrayNodeMapTask)): diff --git a/tests/flytekit/unit/remote/test_remote.py b/tests/flytekit/unit/remote/test_remote.py index 6909b5c391..abb49f3317 100644 --- a/tests/flytekit/unit/remote/test_remote.py +++ b/tests/flytekit/unit/remote/test_remote.py @@ -23,6 +23,7 @@ from flytekit.core.type_engine import TypeEngine from flytekit.exceptions import user as user_exceptions from flytekit.exceptions.user import FlyteEntityNotExistException, FlyteAssertion +from flytekit.experimental.eager_function import eager from flytekit.models import common as common_models from flytekit.models import security from flytekit.models.admin.workflow import Workflow, WorkflowClosure @@ -752,3 +753,22 @@ def my_wf(a: int) -> typing.List[str]: with pytest.raises(FlyteAssertion): _get_pickled_target_dict(my_wf) + +def test_get_pickled_target_dict_with_eager(): + @task + def t1(a: int) -> int: + return a + 1 + + @task + def t2(a: int) -> int: + return a * 2 + + @eager + async def eager_wf(a: int) -> int: + out = await t1(a=a) + if out < 0: + return -1 + return await t2(a=out) + + with pytest.raises(FlyteAssertion): + _get_pickled_target_dict(eager_wf)