Aqib Fayyaz
11/04/2021, 9:30 AMAnna Geller
Kevin Kho
Aqib Fayyaz
11/04/2021, 2:00 PMfrom prefect import Flow
from prefect.tasks.shell import ShellTask
task = ShellTask(helper_script="cd ~")
with Flow("My Flow") as f:
# both tasks will be executed in home directory
contents = task(command='ls')
mv_file = task(command='mv .vimrc /.vimrc')
out = f.run()
This is working it throws error when i intentionally do something wrong but the thing is it does not tell the cause of that error just says [2021-11-04 185731+0500] ERROR - prefect.ShellTask | Command failed with exit code 1
[2021-11-04 185731+0500] INFO - prefect.TaskRunner | FAIL signal raised: FAIL('Command failed with exit code 1')
[2021-11-04 185731+0500] INFO - prefect.TaskRunner | Task 'ShellTask': Finished task run for task with final state: 'Failed'. it would be great if i can see the reason like table not found etcAnna Geller
task = ShellTask(helper_script="cd ~", return_all=True, stream_output=True)
Aqib Fayyaz
11/04/2021, 2:51 PM