<#3509 [Core feature] Improved error message with ...
# flyte-github
a
#3509 [Core feature] Improved error message with maptasks: using it within a task should error out Issue created by cosmicBboy Motivation: Why do you think this is important? Flytekit should raise a runtime error when map tasks are written in any of the following contexts: • When a user tries to write a
map_task
within a
task
function body
Copy code
@task
def t1():
    map_task(...)(...)
• When a user tries to define a
map_task
at the module-level scope
Copy code
@map_task
@task
def t1(): ...
or
Copy code
@task
def t1(): ...


my_map_task = map_task()(t1)
Goal: What should the final outcome look like, ideally? The error should make it clear that `map_task`s can only be defined in workflow function bodies. Describe alternatives you've considered NA Propose: Link/Inline OR Additional context No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte