<#3734 [BUG] Nested @task invocations should not s...
# flyte-github
a
#3734 [BUG] Nested @task invocations should not supported Issue created by eapolinario Describe the bug The documentation defines tasks as the units of execution. This doesn't explicitly disallow nested tasks, in other words, it's reasonable to assume that some users will extrapolate the assertion to cover nested tasks as well (i.e. separate tasks running in separate environments/containers). For example, in this code:
Copy code
@task
def nested_task() -> int:
  return 42

@task
def t1() -> int:
  return nested_task()

@workflow
def wf() -> int:
  return t1()
nested_task
runs in the same process as
task
, as though it was a local execution of that task. Expected behavior Users should receive some indication that nested tasks are not allowed. A log message should suffice. Maybe worth calling out in the documentation as well. Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte