<#3995 [BUG] Flytekit wrongly prints warning for d...
# flyte-github
c
#3995 [BUG] Flytekit wrongly prints warning for dynamic workflows Issue created by fellhorn Describe the bug flyteorg/flytekit#1727 introduced a new warning when people nest tasks/workflows within tasks. As dynamic workflows are partials on the task with a specific execution_mode set, this warning is also printed for completely valid dynamic workflows, e.g.:
Copy code
from flytekit import workflow, dynamic, task

@task
def my_task():
    print("foo")

@dynamic
def outer():
    my_task()


@workflow
def workflow(
):
    outer()

if __name__ == "__main__":
    workflow()
prints:
Copy code
{"asctime": "2023-08-29 11:57:57,824", "name": "flytekit", "levelname": "ERROR", "message": "You are not supposed to nest @Task/@Workflow inside a @Task!"}
foo
Expected behavior The warning should not be print if a task is called within a dynamic node. 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
a