File tree Expand file tree Collapse file tree 2 files changed +52
-445
lines changed
docs/book/how-to/steps-pipelines Expand file tree Collapse file tree 2 files changed +52
-445
lines changed Original file line number Diff line number Diff line change @@ -628,8 +628,8 @@ This is particularly useful for steps that interact with external services or re
628628Hooks allow you to execute custom code at specific points in the pipeline or step lifecycle:
629629
630630``` python
631- def success_hook (step_name , step_output ):
632- print (f " Step { step_name } completed successfully with output: { step_output } " )
631+ def success_hook ():
632+ print (f " Step completed successfully " )
633633
634634def failure_hook (exception : BaseException ):
635635 print (f " Step failed with error: { str (exception)} " )
@@ -639,6 +639,11 @@ def my_step():
639639 return 42
640640```
641641
642+ The following conventions apply to hooks:
643+
644+ * the success hook takes no arguments
645+ * the failure hook takes a single ` BaseException ` typed argument
646+
642647You can also define hooks at the pipeline level to apply to all steps:
643648
644649``` python
You can’t perform that action at this time.
0 commit comments