From da92447d8beacb63076071c518e73bed97e813bc Mon Sep 17 00:00:00 2001 From: Vlad Cozma Date: Fri, 5 Jul 2024 11:37:37 +0200 Subject: [PATCH] Added "-p" cli option to match `kedro` pipeline options (#1961) CLI pipeline option for kedro viz is different than the option for kedro run. Added the -p option for kedro viz along --pipeline option. --- CONTRIBUTING.md | 2 +- README.md | 2 +- RELEASE.md | 1 + package/tests/test_launchers/test_cli.py | 32 ++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 89c575d110..9886fdf58b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,7 +39,7 @@ Working on your first pull request? You can learn how from these resources: - Fork the project - Develop your contribution in a new branch and open a PR against the `main` branch -- Make sure the CI builds are green (have a look at the section [Running checks locally](#running-checks-locally) below) +- Make sure the CI builds are green (have a look at the section [Running checks locally](#testing-guidelines) below) - Update the PR according to the reviewer's comments # Contribution guidelines diff --git a/README.md b/README.md index d36ac4dd75..8b7158c12e 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ Options: --load-file FILE Path to load Kedro-Viz data from a directory --save-file FILE Path to save Kedro-Viz data to a directory - --pipeline TEXT Name of the registered pipeline to visualise. If not + -p, --pipeline TEXT Name of the registered pipeline to visualise. If not set, the default pipeline is visualised -e, --env TEXT Kedro configuration environment. If not specified, diff --git a/RELEASE.md b/RELEASE.md index 4d190772eb..6a0c444866 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -19,6 +19,7 @@ Please follow the established format: - Relax `packaging` pin in requirements. (#1947) - Add favicon to kedro-viz documentation. (#1959) +- Add "-p" flag to kedro-viz to match kedro run. (#1960) - Fix bug related to nested namespace pipelines. (#1897) - Migrate from `toposort` to `graphlib`. (#1942) diff --git a/package/tests/test_launchers/test_cli.py b/package/tests/test_launchers/test_cli.py index d30e651bba..82403cd5e7 100755 --- a/package/tests/test_launchers/test_cli.py +++ b/package/tests/test_launchers/test_cli.py @@ -162,6 +162,38 @@ def mock_project_path(mocker): "extra_params": {"extra_param": "param"}, }, ), + ( + [ + "viz", + "run", + "--host", + "8.8.8.8", + "--port", + "4142", + "--no-browser", + "--save-file", + "save_dir", + "-p", + "data_science", + "-e", + "local", + "--params", + "extra_param=param", + ], + { + "host": "8.8.8.8", + "port": 4142, + "load_file": None, + "save_file": "save_dir", + "pipeline_name": "data_science", + "env": "local", + "project_path": "testPath", + "autoreload": False, + "include_hooks": False, + "package_name": None, + "extra_params": {"extra_param": "param"}, + }, + ), ( ["viz", "run", "--include-hooks"], {