Skip to content

Commit 11da60b

Browse files
committed
Reworked hook validation to elliminate duplicated code
1 parent ec41296 commit 11da60b

File tree

2 files changed

+52
-445
lines changed

2 files changed

+52
-445
lines changed

docs/book/how-to/steps-pipelines/advanced_features.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ This is particularly useful for steps that interact with external services or re
628628
Hooks 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

634634
def 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+
642647
You can also define hooks at the pipeline level to apply to all steps:
643648

644649
```python

0 commit comments

Comments
 (0)