Hooks
The hooks package exposes some standard hooks that can be used in ZenML.
Hooks are functions that run after a step has exited.
alerter_failure_hook(exception)
Standard failure hook that executes after step fails.
This hook uses any BaseAlerter
that is configured within the active stack to post a message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
exception
|
BaseException
|
Original exception that lead to step failing. |
required |
Source code in src/zenml/hooks/alerter_hooks.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
alerter_success_hook()
Standard success hook that executes after step finishes successfully.
This hook uses any BaseAlerter
that is configured within the active stack to post a message.
Source code in src/zenml/hooks/alerter_hooks.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
resolve_and_validate_hook(hook)
Resolves and validates a hook callback.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hook
|
HookSpecification
|
Hook function or source. |
required |
Returns:
Type | Description |
---|---|
Source
|
Hook source. |
Raises:
Type | Description |
---|---|
ValueError
|
If |
Source code in src/zenml/hooks/hook_validators.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|