flyte icon indicating copy to clipboard operation
flyte copied to clipboard

[Core feature] Improved error message with maptasks: using it within a task should error out

Open cosmicbboy opened this issue 3 years ago • 2 comments

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
@task
def t1():
    map_task(...)(...)
  • When a user tries to define a map_task at the module-level scope
@map_task
@task
def t1(): ...

or

@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_tasks 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?

  • [X] Yes

Have you read the Code of Conduct?

  • [X] Yes

cosmicbboy avatar Mar 21 '23 21:03 cosmicbboy

#take

davidlin20dev avatar Nov 11 '24 15:11 davidlin20dev

"Hello 👋, this feature request has been inactive for over 9 months. To help maintain a clean and focused backlog, we'll be marking this issue as stale and will close the issue if we detect no activity in the next 14 days. Thank you for your contribution and understanding! 🙏"

github-actions[bot] avatar Aug 09 '25 00:08 github-actions[bot]