Skip to content

Commit

Permalink
Update kedro pipeline create/delete to get base env from project se…
Browse files Browse the repository at this point in the history
…ttings (#3677)

* Update pipeline create and delete commands to work with base env in the settings

Signed-off-by: Ankita Katiyar <[email protected]>

* Return default base value

Signed-off-by: Ankita Katiyar <[email protected]>

* Ignore unused ignores mypy

Signed-off-by: Ankita Katiyar <[email protected]>

---------

Signed-off-by: Ankita Katiyar <[email protected]>
  • Loading branch information
ankatiyar authored Mar 5, 2024
1 parent 1bbfdea commit ac589ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ clean:

lint:
pre-commit run -a --hook-stage manual $(hook)
mypy kedro --strict --allow-any-generics
mypy kedro --strict --allow-any-generics --no-warn-unused-ignores
test:
pytest --numprocesses 4 --dist loadfile

Expand Down
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Major features and improvements

## Bug fixes and other changes
* Updated `kedro pipeline create` and `kedro pipeline delete` to read the base environment from the project settings.

## Breaking changes to the API

Expand Down
8 changes: 4 additions & 4 deletions kedro/framework/cli/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def create_pipeline(
package_dir = metadata.source_dir / metadata.package_name
conf_source = settings.CONF_SOURCE
project_conf_path = metadata.project_path / conf_source

env = env or "base"
base_env = settings.CONFIG_LOADER_ARGS.get("base_env", "base")
env = env or base_env
if not skip_config and not (project_conf_path / env).exists():
raise KedroCliError(
f"Unable to locate environment '{env}'. "
Expand Down Expand Up @@ -152,8 +152,8 @@ def delete_pipeline(
package_dir = metadata.source_dir / metadata.package_name
conf_source = settings.CONF_SOURCE
project_conf_path = metadata.project_path / conf_source

env = env or "base"
base_env = settings.CONFIG_LOADER_ARGS.get("base_env", "base")
env = env or base_env
if not (project_conf_path / env).exists():
raise KedroCliError(
f"Unable to locate environment '{env}'. "
Expand Down

0 comments on commit ac589ca

Please sign in to comment.