Skip to content

Commit

Permalink
Add docstring and release notes for raise_errors
Browse files Browse the repository at this point in the history
Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu>
  • Loading branch information
deepyaman committed Apr 18, 2024
1 parent 6da44f5 commit 47b9017
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Upcoming Release 0.19.5

## Major features and improvements
* Added `raise_errors` argument to `find_pipelines`. If `True`, the first pipeline for which autodiscovery fails will cause an error to be raised. The default behavior is still to raise a warning for each failing pipeline.

Check warning on line 4 in RELEASE.md

View workflow job for this annotation

GitHub Actions / vale

[vale] RELEASE.md#L4

[Kedro.Spellings] Did you really mean 'autodiscovery'?
Raw output
{"message": "[Kedro.Spellings] Did you really mean 'autodiscovery'?", "location": {"path": "RELEASE.md", "range": {"start": {"line": 4, "column": 94}}}, "severity": "WARNING"}

## Bug fixes and other changes

Expand All @@ -25,7 +26,7 @@
* Updated `kedro pipeline create` and `kedro pipeline delete` to read the base environment from the project settings.
* Updated CLI command `kedro catalog resolve` to read credentials properly.
* Changed the path of where pipeline tests generated with `kedro pipeline create` from `<project root>/src/tests/pipelines/<pipeline name>` to `<project root>/tests/pipelines/<pipeline name>`.
* Updated ``.gitignore`` to prevent pushing Mlflow local runs folder to a remote forge when using mlflow and git.
* Updated ``.gitignore`` to prevent pushing MLflow local runs folder to a remote forge when using MLflow and Git.
* Fixed error handling message for malformed yaml/json files in OmegaConfigLoader.
* Fixed a bug in `node`-creation allowing self-dependencies when using transcoding, that is datasets named like `name@format`.
* Improved error message when passing wrong value to node.
Expand Down
10 changes: 10 additions & 0 deletions kedro/framework/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,23 @@ def find_pipelines(raise_errors: bool = False) -> dict[str, Pipeline]: # noqa:
For more information on the pipeline registry and autodiscovery, see
https://kedro.readthedocs.io/en/stable/nodes_and_pipelines/pipeline_registry.html
Args:
raise_errors: If ``True``, raise an error upon failed discovery.
Returns:
A generated mapping from pipeline names to ``Pipeline`` objects.
Raises:
ImportError: When a module does not expose a ``create_pipeline``
function, the ``create_pipeline`` function does not return a
``Pipeline`` object, or if the module import fails up front.
If ``raise_errors`` is ``False``, see Warns section instead.
Warns:
UserWarning: When a module does not expose a ``create_pipeline``
function, the ``create_pipeline`` function does not return a
``Pipeline`` object, or if the module import fails up front.
If ``raise_errors`` is ``True``, see Raises section instead.
"""
pipeline_obj = None

Expand Down
4 changes: 4 additions & 0 deletions kedro/pipeline/modular_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ def _get_dataset_names_mapping(
the same as they are named in the provided pipeline.
When dict[str, str] is provided, current names will be
mapped to new names in the resultant pipeline.
Returns:
A dictionary that maps the old dataset names to the provided ones.
Examples:
>>> _get_dataset_names_mapping("dataset_name")
{"dataset_name": "dataset_name"} # a str name will stay the same
Expand Down Expand Up @@ -138,8 +140,10 @@ def _get_param_names_mapping(
the same as they are named in the provided pipeline.
When dict[str, str] is provided, current names will be
mapped to new names in the resultant pipeline.
Returns:
A dictionary that maps the old parameter names to the provided ones.
Examples:
>>> _get_param_names_mapping("param_name")
{"params:param_name": "params:param_name"} # a str name will stay the same
Expand Down

0 comments on commit 47b9017

Please sign in to comment.