https://prefect.io logo
Title
j

Jon

11/17/2022, 2:19 PM
hi, I'm on prefect 1 using this pattern to pass a task's result from a child flow to a parent flow: https://discourse.prefect.io/t/how-to-pass-data-from-a-child-flow-to-another-task-in-a-parent-flow/126 the child flow is mapped with
create_flow_run.map
. How to get the results of the mapped flow? I'm getting this error:
└── 09:11:14 | ERROR   | Task 'get_task_run_result': Exception encountered during task execution!
Traceback (most recent call last):
  File "/Users/jonyoung/Dev/workflows/.venv/lib/python3.9/site-packages/prefect/engine/task_runner.py", line 880, in get_task_run_state
    value = prefect.utilities.executors.run_task_with_timeout(
  File "/Users/jonyoung/Dev/workflows/.venv/lib/python3.9/site-packages/prefect/utilities/executors.py", line 468, in run_task_with_timeout
    return task.run(*args, **kwargs)  # type: ignore
  File "/Users/jonyoung/Dev/workflows/.venv/lib/python3.9/site-packages/prefect/tasks/prefect/flow_run.py", line 220, in get_task_run_result
    flow_run = FlowRunView.from_flow_run_id(flow_run_id)
  File "/Users/jonyoung/Dev/workflows/.venv/lib/python3.9/site-packages/prefect/backend/flow_run.py", line 585, in from_flow_run_id
    flow_run_data = cls._query_for_flow_run(where={"id": {"_eq": flow_run_id}})
  File "/Users/jonyoung/Dev/workflows/.venv/lib/python3.9/site-packages/prefect/backend/flow_run.py", line 627, in _query_for_flow_run
    result = client.graphql(flow_run_query)
  File "/Users/jonyoung/Dev/workflows/.venv/lib/python3.9/site-packages/prefect/client/client.py", line 464, in graphql
    raise ClientError(result["errors"])
prefect.exceptions.ClientError: [{'message': 'parsing UUID failed, expected String, but encountered Array', 'locations': [{'line': 2, 'column': 5}], 'path': ['flow_run'], 'extensions': {'path': '$.selectionSet.flow_run.args.where.id._eq', 'code': 'parse-failed', 'exception': {'message': 'parsing UUID failed, expected String, but encountered Array'}}}]
1
i think i answered this. for anyone else w this issue, you can map over
get_task_run_result:
get_task_run_result.map(
        flow_run_id=transform_flow,
        task_slug=prefect.unmapped(f"{post_silver_file_to_s3_task_name}-1"),
    )
1
🚀 1
b

Bianca Hoch

11/17/2022, 2:33 PM
Thank you for sharing your solution here, Jon!
j

Jon

11/17/2022, 2:34 PM
yup np