flyte
flyte copied to clipboard
[Core feature] Improved error message with maptasks: using it within a task should error out
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_taskwithin ataskfunction body
@task
def t1():
map_task(...)(...)
- When a user tries to define a
map_taskat 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
#take
"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! 🙏"