https://flyte.org logo
#ask-the-community
Title
# ask-the-community
t

Tommy Nam

05/19/2023, 4:45 AM
Does anybody else run into errors when trying to use map task workflows with Papermill/Jupyter NotebookTasks? Running the example from the docs (https://docs.flyte.org/projects/cookbook/en/latest/auto/core/control_flow/map_task.html#map-a-task-with-multiple-inputs), and a plain @task decorated function works fine - but the moment I attempt to run a map task with NotebookTasks, I get this error:
Copy code
ValueError: Error encountered while executing 'run_map_task_workflow':
  Map tasks can only compose of Python Functon Tasks currently
Is
flytekitplugins.papermill.NotebookTask
currently incompatible with map_tasks?
k

Ketan (kumare3)

05/19/2023, 5:00 AM
Great point. this is not supported, but actually is very easy to support. can you share how you are wanting to run the notebook task, are you using
functools.partial
We should be able to add support for this pretty rapidly
cc @Kevin Su / @Evan Sadler can either of you add support?
k

Kevin Su

05/19/2023, 5:02 AM
looking
we should support python_instance_task too
@Kevin Su maybe you cannot use functools.partial with instance tasks. I do not know that, if that is the case, this is just handling instance task separately and we are good
t

Tommy Nam

05/19/2023, 5:50 AM
@Ketan (kumare3) I'm not too sure about functools.partial, but we are using the flytekit plugin for Jupyter.
*from* flytekitplugins.papermill *import* NotebookTask
And then we are passing in this NotebookTask into something like this:
Copy code
# Example

@workflow
def map_workflow():
   map_output = map_task(notebook_task_here)(inputs=input_list)
   return map_output
k

Ketan (kumare3)

05/19/2023, 5:57 AM
Cool, ya this is a miss on my end when I wrote map task
We will fix it soon
t

Tommy Nam

05/19/2023, 6:09 AM
Cool, thank you for the quick response!
k

Kevin Su

05/19/2023, 6:28 AM