Mahesh
01/06/2022, 3:12 PMMahesh
01/06/2022, 3:12 PMfrom prefect import context
flowids=prefect.context.get("flow_run_id")
print (flowids)
test=ShellTask(
shell="bash",
return_all=True,
log_stderr=True,
log_stdout=True,
stream_output=True,
command="echo Hello {}".format(flowids)
)
Mahesh
01/06/2022, 3:13 PM[2022-01-06 15:10:29+0000] INFO - prefect.FlowRunner | Beginning Flow run for 'Dimension1'
[2022-01-06 15:10:29+0000] INFO - prefect.TaskRunner | Task 'ShellTask': Starting task run...
[2022-01-06 15:10:29+0000] INFO - prefect.ShellTask | Hello None
[2022-01-06 15:10:29+0000] INFO - prefect.TaskRunner | Task 'ShellTask': Finished task run for task with final state: 'Success'
[2022-01-06 15:10:29+0000] INFO - prefect.FlowRunner | Flow run SUCCESS: all reference tasks succeeded
Kevin Kho