Hi all, I am trying to pass parameters from the ou...
# prefect-community
s
Hi all, I am trying to pass parameters from the output of a Parent Task to a child flow. These parameters are dataframes that a few other child processes will use as well however I receive the below TypeError: My question is what is the best way to pass data from Parent to Child flows? I am trying to avoid querying multiple times since the query is intensive
TypeError: Object of type DataFrame is not JSON serializable
1
a
You can pass data between tasks, but it's much harder to do between flows since each flow may in theory even run on completely different machines You can either persist this data somewhere and retrieve it in your another flow, or try the get_task_run_result task https://github.com/PrefectHQ/prefect/blob/ad734292bc4113a52777d6ebe87cfa1c13a3eee8/src/prefect/tasks/prefect/flow_run.py#L176
Btw in Prefect 2.0 this is way easier
s
Do you have an example of this case? I want the ParentFlow to read a dataframe processed by a child flow. Would I save the child flow's result in a Result and then from the parent Flow try to use get_task_run_result? Also, I am not familiar with SLug IDs is this a return value from the create_flow_run?