Skip to content

Commit

Permalink
Add documentation for kedro run lifecycle (#3482)
Browse files Browse the repository at this point in the history
* draft
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* update release notes

Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>

* release note update

Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>

* Update the list of hook spec to match execution order

Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>

* add diagram

Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
  • Loading branch information
noklam authored Jan 15, 2024
1 parent d433ff3 commit 4c593ac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
* Added logging about not using async mode in `SequentiallRunner` and `ParallelRunner`.

## Documentation changes
* Added documentations about `bootstrap_project` and `configure_project`.
* Added documentation about `bootstrap_project` and `configure_project`.
* Added documentation about `kedro run` and hook execution order.

## Community contributions

Expand Down
16 changes: 9 additions & 7 deletions docs/source/hooks/introduction.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hooks
# Introduction to Hooks

## Concepts

Expand All @@ -8,18 +8,18 @@ A Hook consists of a Hook specification, and Hook implementation.

Kedro defines Hook specifications for particular execution points where users can inject additional behaviour. Currently, the following Hook specifications are provided in [kedro.framework.hooks](/kedro.framework.hooks):

* `after_context_created`
* `after_catalog_created`
* `before_node_run`
* `after_node_run`
* `on_node_error`
* `before_pipeline_run`
* `after_pipeline_run`
* `on_pipeline_error`
* `before_dataset_loaded`
* `after_dataset_loaded`
* `before_node_run`
* `after_node_run`
* `before_dataset_saved`
* `after_dataset_saved`
* `after_context_created`
* `after_pipeline_run`
* `on_node_error`
* `on_pipeline_error`

The naming convention for non-error Hooks is `<before/after>_<noun>_<past_participle>`, in which:

Expand All @@ -32,6 +32,8 @@ The naming convention for error hooks is `on_<noun>_error`, in which:

[kedro.framework.hooks](/kedro.framework.hooks) lists the full specifications for which you can inject additional behaviours by providing an implementation.

This diagram illustrates the execution order of hooks during `kedro run`:
![kedro run hook execution order](../meta/images/kedro_run_lifecycle.png)

### CLI Hooks

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4c593ac

Please sign in to comment.