We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
map_task
Using map_task with a partially applied function will raise an exception depending on the order of srguments in the original function definition.
Argument order ought not to matter with a partially applied function being mapped. This would align with Python syntax.
Workflow python file workflows/example.py:
workflows/example.py
from functools import partial from flytekit import map_task, task, workflow @task() def create_names() -> list[str]: return ["a", "bb", "ccc"] @task() def get_number() -> int: return 3 @task() def multiply_name( number: int, name: str, ) -> str: return " ".join([name] * number) @workflow def process_all() -> list[str]: name_list = create_names() number = get_number() multiply_name_partial = partial( multiply_name, number=number, ) result = map_task(multiply_name_partial)(name=name_list) return result
Python 3.11.5
requirements.in:
black==23.9.1 dataclasses-json==0.6.1 flytekit==1.8.0 marshmallow-enum==1.5.1 ipykernel==6.25.2 isort==5.12.0
To reproduce: pyflyte run workflows/example.py process_all
pyflyte run workflows/example.py process_all
It will work of you change the argument order in the multiply_nametask to this:
multiply_name
@task() def multiply_name( name: str, number: int, ) -> str: return " ".join([name] * number)
No response
The text was updated successfully, but these errors were encountered:
Thank you for opening your first issue here! 🛠
Sorry, something went wrong.
Hello @pingsutw, can you please assign me this issue?
Sorry for the inconvenience @pingsutw , you may assign this to someone else.
Hi @pingsutw, can you assign this issue to me, thanks.
chaohengstudent
Successfully merging a pull request may close this issue.
Describe the bug
Using
map_task
with a partially applied function will raise an exception depending on the order of srguments in the original function definition.Expected behavior
Argument order ought not to matter with a partially applied function being mapped. This would align with Python syntax.
Additional context to reproduce
Workflow python file
workflows/example.py
:Python 3.11.5
requirements.in:
To reproduce:
pyflyte run workflows/example.py process_all
It will work of you change the argument order in the
multiply_name
task to this:Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: