From 65041c4244cf907daccec7b57459099f0f9549eb Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Tue, 26 Nov 2024 10:53:14 +0000 Subject: [PATCH 01/19] done Signed-off-by: rashidakanchwala --- package/kedro_viz/launchers/cli/run.py | 25 +++++++++++++++---------- package/kedro_viz/server.py | 3 --- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/package/kedro_viz/launchers/cli/run.py b/package/kedro_viz/launchers/cli/run.py index e4093b940..2b2829a17 100644 --- a/package/kedro_viz/launchers/cli/run.py +++ b/package/kedro_viz/launchers/cli/run.py @@ -123,16 +123,21 @@ def run( ) from kedro_viz.server import run_server - kedro_project_path = _find_kedro_project(Path.cwd()) - - if kedro_project_path is None: - display_cli_message( - "ERROR: Failed to start Kedro-Viz : " - "Could not find the project configuration " - f"file '{_PYPROJECT}' at '{Path.cwd()}'. ", - "red", - ) - return + + if load_file: + if not Path(load_file).exists(): + raise ValueError(f"The provided filepath '{load_file}' does not exist.") + kedro_project_path = None + else: + kedro_project_path = _find_kedro_project(Path.cwd()) + if kedro_project_path is None: + display_cli_message( + "ERROR: Failed to start Kedro-Viz : " + "Could not find the project configuration " + f"file '{_PYPROJECT}' at '{Path.cwd()}'. ", + "red", + ) + return installed_version = parse(__version__) latest_version = get_latest_version() diff --git a/package/kedro_viz/server.py b/package/kedro_viz/server.py index db95289b6..8643bec73 100644 --- a/package/kedro_viz/server.py +++ b/package/kedro_viz/server.py @@ -132,9 +132,6 @@ def run_server( app = apps.create_api_app_from_project(path, autoreload) else: - if not Path(load_file).exists(): - raise ValueError(f"The provided filepath '{load_file}' does not exist.") - app = apps.create_api_app_from_file(f"{path}/{load_file}/api") uvicorn.run(app, host=host, port=port, log_config=None) From 242f35b5d161c5f2266a6407f689037439108d9e Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Tue, 26 Nov 2024 13:50:01 +0000 Subject: [PATCH 02/19] fix lint Signed-off-by: rashidakanchwala --- package/kedro_viz/launchers/cli/run.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/kedro_viz/launchers/cli/run.py b/package/kedro_viz/launchers/cli/run.py index 2b2829a17..c27218b3a 100644 --- a/package/kedro_viz/launchers/cli/run.py +++ b/package/kedro_viz/launchers/cli/run.py @@ -123,11 +123,10 @@ def run( ) from kedro_viz.server import run_server - if load_file: if not Path(load_file).exists(): raise ValueError(f"The provided filepath '{load_file}' does not exist.") - kedro_project_path = None + kedro_project_path = None else: kedro_project_path = _find_kedro_project(Path.cwd()) if kedro_project_path is None: From a9aca8a8b2ac44dbe287dd2901a1a79201a7acdb Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Tue, 26 Nov 2024 14:47:50 +0000 Subject: [PATCH 03/19] fix tests Signed-off-by: rashidakanchwala --- .../tests/test_launchers/test_cli/test_run.py | 21 +++++++++++ package/tests/test_server.py | 35 +++++-------------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/package/tests/test_launchers/test_cli/test_run.py b/package/tests/test_launchers/test_cli/test_run.py index 95a809d2e..ccf579b0f 100644 --- a/package/tests/test_launchers/test_cli/test_run.py +++ b/package/tests/test_launchers/test_cli/test_run.py @@ -1,3 +1,4 @@ +from pathlib import Path from unittest.mock import call import pytest @@ -411,3 +412,23 @@ def test_find_available_port_with_occupied_ports(self, mocker): assert ( available_port == 4143 ), "Expected port 4143 to be returned as the available port" + + +def test_invalid_load_file_directory(mocker): + """ + Test that Kedro-Viz raises a ValueError when an invalid filepath + is provided to the `--load-file` argument. + """ + runner = CliRunner() + + # Mock the existence of the file path to always return False (invalid path) + mocker.patch.object(Path, "exists", return_value=False) + + # Invoke the CLI with an invalid `--load-file` path + result = runner.invoke( + main.viz_cli, ["viz", "run", "--load-file", "nonexistent_path.json"] + ) + + assert "The provided filepath 'nonexistent_path.json' does not exist." == str( + result.exception + ) diff --git a/package/tests/test_server.py b/package/tests/test_server.py index 2169e9d4d..ca8d19a2c 100644 --- a/package/tests/test_server.py +++ b/package/tests/test_server.py @@ -121,32 +121,15 @@ def test_specific_pipeline( {"data_science": example_pipelines["data_science"]} ) - @pytest.mark.parametrize( - "file_path, expected_exception", - [ - ("test.json", ValueError), # File does not exist, expect ValueError - ("test.json", None), # File exists, expect no ValueError - ], - ) - def test_load_file( - self, file_path, expected_exception, patched_create_api_app_from_file, tmp_path - ): - if expected_exception is not None: - with pytest.raises(expected_exception) as exc_info: - run_server(load_file=file_path) - - # Check if the error message contains the expected message - assert "The provided filepath" in str(exc_info.value) - assert "does not exist." in str(exc_info.value) - else: - json_file_path = tmp_path / file_path - - # File exists, no exception expected - with json_file_path.open("w") as file: - json.dump({"name": "John", "age": 30}, file) - - run_server(load_file=json_file_path) - patched_create_api_app_from_file.assert_called_once() + def test_load_file(self, patched_create_api_app_from_file, tmp_path): + file_path = "test.json" + json_file_path = tmp_path / file_path + + with json_file_path.open("w") as file: + json.dump({"name": "John", "age": 30}, file) + + run_server(load_file=json_file_path) + patched_create_api_app_from_file.assert_called_once() def test_save_file(self, tmp_path, mocker): mock_filesystem = mocker.patch("fsspec.filesystem") From 2b722cf78965f896bc23169e122a3b7bb083ba3b Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Tue, 26 Nov 2024 14:55:26 +0000 Subject: [PATCH 04/19] fix tests Signed-off-by: rashidakanchwala --- package/kedro_viz/launchers/cli/run.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/kedro_viz/launchers/cli/run.py b/package/kedro_viz/launchers/cli/run.py index c27218b3a..50f9df1b6 100644 --- a/package/kedro_viz/launchers/cli/run.py +++ b/package/kedro_viz/launchers/cli/run.py @@ -126,7 +126,6 @@ def run( if load_file: if not Path(load_file).exists(): raise ValueError(f"The provided filepath '{load_file}' does not exist.") - kedro_project_path = None else: kedro_project_path = _find_kedro_project(Path.cwd()) if kedro_project_path is None: @@ -164,7 +163,7 @@ def run( "save_file": save_file, "pipeline_name": pipeline, "env": env, - "project_path": kedro_project_path, + "project_path": kedro_project_path or None, "autoreload": autoreload, "include_hooks": include_hooks, "package_name": PACKAGE_NAME, From c68feb40b595b650327e2f99942067192ba40af2 Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Tue, 26 Nov 2024 14:58:41 +0000 Subject: [PATCH 05/19] fix tests -1 Signed-off-by: rashidakanchwala --- package/kedro_viz/launchers/cli/run.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/kedro_viz/launchers/cli/run.py b/package/kedro_viz/launchers/cli/run.py index 50f9df1b6..c68f4e652 100644 --- a/package/kedro_viz/launchers/cli/run.py +++ b/package/kedro_viz/launchers/cli/run.py @@ -122,6 +122,8 @@ def run( display_cli_message, ) from kedro_viz.server import run_server + + kedro_project_path = None if load_file: if not Path(load_file).exists(): @@ -163,8 +165,7 @@ def run( "save_file": save_file, "pipeline_name": pipeline, "env": env, - "project_path": kedro_project_path or None, - "autoreload": autoreload, + "project_path": kedro_project_path, "include_hooks": include_hooks, "package_name": PACKAGE_NAME, "extra_params": params, From c63991e06ad363f3d117d467db8ae470a1749fab Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Tue, 26 Nov 2024 15:08:30 +0000 Subject: [PATCH 06/19] remove accident deleting Signed-off-by: rashidakanchwala --- package/kedro_viz/launchers/cli/run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/kedro_viz/launchers/cli/run.py b/package/kedro_viz/launchers/cli/run.py index c68f4e652..466d7f7aa 100644 --- a/package/kedro_viz/launchers/cli/run.py +++ b/package/kedro_viz/launchers/cli/run.py @@ -122,7 +122,7 @@ def run( display_cli_message, ) from kedro_viz.server import run_server - + kedro_project_path = None if load_file: @@ -166,6 +166,7 @@ def run( "pipeline_name": pipeline, "env": env, "project_path": kedro_project_path, + "autoreload": autoreload, "include_hooks": include_hooks, "package_name": PACKAGE_NAME, "extra_params": params, From cc8a0cc151715302705f0f7956294c714c2c392a Mon Sep 17 00:00:00 2001 From: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:56:04 +0000 Subject: [PATCH 07/19] Update test_run.py Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> --- package/tests/test_launchers/test_cli/test_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/tests/test_launchers/test_cli/test_run.py b/package/tests/test_launchers/test_cli/test_run.py index ccf579b0f..4a4b8cd37 100644 --- a/package/tests/test_launchers/test_cli/test_run.py +++ b/package/tests/test_launchers/test_cli/test_run.py @@ -417,7 +417,7 @@ def test_find_available_port_with_occupied_ports(self, mocker): def test_invalid_load_file_directory(mocker): """ Test that Kedro-Viz raises a ValueError when an invalid filepath - is provided to the `--load-file` argument. + is provided to the `--load-file` argument """ runner = CliRunner() From d905f157a02cee734c1084e9315bd228eb4d0830 Mon Sep 17 00:00:00 2001 From: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:56:20 +0000 Subject: [PATCH 08/19] Update test_run.py Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> --- package/tests/test_launchers/test_cli/test_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/tests/test_launchers/test_cli/test_run.py b/package/tests/test_launchers/test_cli/test_run.py index 4a4b8cd37..ccf579b0f 100644 --- a/package/tests/test_launchers/test_cli/test_run.py +++ b/package/tests/test_launchers/test_cli/test_run.py @@ -417,7 +417,7 @@ def test_find_available_port_with_occupied_ports(self, mocker): def test_invalid_load_file_directory(mocker): """ Test that Kedro-Viz raises a ValueError when an invalid filepath - is provided to the `--load-file` argument + is provided to the `--load-file` argument. """ runner = CliRunner() From 127b17cdb4e0bfc4d46a26e137144211e66998a7 Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Wed, 27 Nov 2024 09:57:41 +0000 Subject: [PATCH 09/19] update docs Signed-off-by: rashidakanchwala --- docs/source/cli-docs.md | 24 ++++++++++++++++++++++-- docs/source/kedro-viz_visualisation.md | 4 ++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/source/cli-docs.md b/docs/source/cli-docs.md index 72ea1b8af..902771028 100644 --- a/docs/source/cli-docs.md +++ b/docs/source/cli-docs.md @@ -44,10 +44,10 @@ kedro viz run [OPTIONS] - Whether to open the Kedro Viz interface in the default browser. The browser will open if the host is `localhost`. Defaults to `True`. - `--load-file ` - - Path to load Kedro Viz data from a directory. If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline. + - Path to load Kedro Viz data from a [directory]((#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline - `--save-file ` - - Path to save Kedro Viz data to a directory. If provided, the visualisation data will be saved to this path for later use. + - Path to save Kedro Viz data to a [directory]((#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, the visualisation data will be saved to this path for later use. - `--pipeline, -p ` - Name of the registered pipeline to visualise. If not set, the default pipeline is visualised. @@ -162,4 +162,24 @@ kedro viz build --include-previews ``` +### Kedro-viz directory structure when you save it as a file + +When you use the `--save-file` option, Kedro Viz generates a directory structure to save the visualization data. This directory can later be used with the `--load-file` to reload the visualization. + +The generated directory structure looks like this: + +```bash +api/ +├── main/ +│ └── pipeline.json # Main file containing pipeline structure and metadata +├── nodes/ +│ ├── node1.json # JSON files for individual nodes +│ ├── node2.json +│ └── ... +├── pipelines/ +│ ├── pipeline1.json # JSON files for individual pipelines +│ ├── pipeline2.json +│ └── ... +``` + diff --git a/docs/source/kedro-viz_visualisation.md b/docs/source/kedro-viz_visualisation.md index de4509e5b..66c9cf651 100644 --- a/docs/source/kedro-viz_visualisation.md +++ b/docs/source/kedro-viz_visualisation.md @@ -279,8 +279,8 @@ The `%run_viz` command supports various optional arguments found in `kedro viz r * `--host=`: Specify the server host. * `--port=`: Set the server port. -* `--load-file=`: Load a specific pipeline visualisation file. -* `--save-file=`: Save the current pipeline visualisation to a file. +* `--load-file=`: Load a specific pipeline visualisation from a [directory](./cli-docs.md#kedro-viz-directory-structure-when-you-save-it-as-a-file). +* `--save-file=`: Save the current pipeline visualisation to a [directory](./cli-docs.md#kedro-viz-directory-structure-when-you-save-it-as-a-file). * `--pipeline=`: Visualise a specific pipeline. * `--env=`: Set the environment for the visualisation. * `--autoreload`: Enable automatic reloading of the visualisation when source code changes. From 9ad595a5da5df1161973e8550a4c82876bc912df Mon Sep 17 00:00:00 2001 From: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:59:58 +0000 Subject: [PATCH 10/19] Update cli-docs.md Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> --- docs/source/cli-docs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/cli-docs.md b/docs/source/cli-docs.md index 902771028..0b21857d3 100644 --- a/docs/source/cli-docs.md +++ b/docs/source/cli-docs.md @@ -44,10 +44,10 @@ kedro viz run [OPTIONS] - Whether to open the Kedro Viz interface in the default browser. The browser will open if the host is `localhost`. Defaults to `True`. - `--load-file ` - - Path to load Kedro Viz data from a [directory]((#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline + - Path to load Kedro Viz data from a [directory](#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline - `--save-file ` - - Path to save Kedro Viz data to a [directory]((#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, the visualisation data will be saved to this path for later use. + - Path to save Kedro Viz data to a [directory](#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, the visualisation data will be saved to this path for later use. - `--pipeline, -p ` - Name of the registered pipeline to visualise. If not set, the default pipeline is visualised. From 6134de10a41c4fc5d7efd7d99873b2140598f05a Mon Sep 17 00:00:00 2001 From: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:00:59 +0000 Subject: [PATCH 11/19] Update cli-docs.md Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> --- docs/source/cli-docs.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/source/cli-docs.md b/docs/source/cli-docs.md index 0b21857d3..8aec04c01 100644 --- a/docs/source/cli-docs.md +++ b/docs/source/cli-docs.md @@ -170,15 +170,14 @@ The generated directory structure looks like this: ```bash api/ -├── main/ -│ └── pipeline.json # Main file containing pipeline structure and metadata +├── main # Main file containing pipeline structure and metadata ├── nodes/ -│ ├── node1.json # JSON files for individual nodes -│ ├── node2.json +│ ├── node1 # JSON files for individual nodes +│ ├── node2 │ └── ... ├── pipelines/ -│ ├── pipeline1.json # JSON files for individual pipelines -│ ├── pipeline2.json +│ ├── pipeline1 # JSON files for individual pipelines +│ ├── pipeline2 │ └── ... ``` From fadf23b505cdd76f6948a7b7cfcff69c437c361b Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Wed, 27 Nov 2024 10:19:27 +0000 Subject: [PATCH 12/19] fix docs errror Signed-off-by: rashidakanchwala --- docs/source/cli-docs.md | 4 ++-- docs/source/kedro-viz_visualisation.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/cli-docs.md b/docs/source/cli-docs.md index 8aec04c01..e5c6243d3 100644 --- a/docs/source/cli-docs.md +++ b/docs/source/cli-docs.md @@ -44,10 +44,10 @@ kedro viz run [OPTIONS] - Whether to open the Kedro Viz interface in the default browser. The browser will open if the host is `localhost`. Defaults to `True`. - `--load-file ` - - Path to load Kedro Viz data from a [directory](#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline + - Path to load Kedro Viz data from a [directory](https://docs.kedro.org/projects/kedro-viz/en/stable/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline - `--save-file ` - - Path to save Kedro Viz data to a [directory](#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, the visualisation data will be saved to this path for later use. + - Path to save Kedro Viz data to a [directory](https://docs.kedro.org/projects/kedro-viz/en/stable/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, the visualisation data will be saved to this path for later use. - `--pipeline, -p ` - Name of the registered pipeline to visualise. If not set, the default pipeline is visualised. diff --git a/docs/source/kedro-viz_visualisation.md b/docs/source/kedro-viz_visualisation.md index 66c9cf651..cfc131e94 100644 --- a/docs/source/kedro-viz_visualisation.md +++ b/docs/source/kedro-viz_visualisation.md @@ -279,8 +279,8 @@ The `%run_viz` command supports various optional arguments found in `kedro viz r * `--host=`: Specify the server host. * `--port=`: Set the server port. -* `--load-file=`: Load a specific pipeline visualisation from a [directory](./cli-docs.md#kedro-viz-directory-structure-when-you-save-it-as-a-file). -* `--save-file=`: Save the current pipeline visualisation to a [directory](./cli-docs.md#kedro-viz-directory-structure-when-you-save-it-as-a-file). +* `--load-file=`: Load a specific pipeline visualisation from a [directory](https://docs.kedro.org/projects/kedro-viz/en/stable/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). +* `--save-file=`: Save the current pipeline visualisation to a [directory](https://docs.kedro.org/projects/kedro-viz/en/stable/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). * `--pipeline=`: Visualise a specific pipeline. * `--env=`: Set the environment for the visualisation. * `--autoreload`: Enable automatic reloading of the visualisation when source code changes. From ef69013d4d8d0981420c9861934932267bdfe714 Mon Sep 17 00:00:00 2001 From: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:20:05 +0000 Subject: [PATCH 13/19] Update cli-docs.md Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> --- docs/source/cli-docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/cli-docs.md b/docs/source/cli-docs.md index e5c6243d3..97eba3539 100644 --- a/docs/source/cli-docs.md +++ b/docs/source/cli-docs.md @@ -170,7 +170,7 @@ The generated directory structure looks like this: ```bash api/ -├── main # Main file containing pipeline structure and metadata +├── main # Main file containing pipeline structure ├── nodes/ │ ├── node1 # JSON files for individual nodes │ ├── node2 From 9d72f1758a8daaeb65b2844041946ebce1abb345 Mon Sep 17 00:00:00 2001 From: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:08:48 +0000 Subject: [PATCH 14/19] Update cli-docs.md Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> --- docs/source/cli-docs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/cli-docs.md b/docs/source/cli-docs.md index 97eba3539..a5e5b7fe2 100644 --- a/docs/source/cli-docs.md +++ b/docs/source/cli-docs.md @@ -44,10 +44,10 @@ kedro viz run [OPTIONS] - Whether to open the Kedro Viz interface in the default browser. The browser will open if the host is `localhost`. Defaults to `True`. - `--load-file ` - - Path to load Kedro Viz data from a [directory](https://docs.kedro.org/projects/kedro-viz/en/stable/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline + - Path to load Kedro Viz data from a [directory](https://docs.kedro.org/projects/kedro-viz/en/latest/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline - `--save-file ` - - Path to save Kedro Viz data to a [directory](https://docs.kedro.org/projects/kedro-viz/en/stable/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, the visualisation data will be saved to this path for later use. + - Path to save Kedro Viz data to a [directory](https://docs.kedro.org/projects/kedro-viz/en/latest/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, the visualisation data will be saved to this path for later use. - `--pipeline, -p ` - Name of the registered pipeline to visualise. If not set, the default pipeline is visualised. From 7480778387e59d2aaefa1f253597e5c4868c9e2d Mon Sep 17 00:00:00 2001 From: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:09:23 +0000 Subject: [PATCH 15/19] Update kedro-viz_visualisation.md Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> --- docs/source/kedro-viz_visualisation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/kedro-viz_visualisation.md b/docs/source/kedro-viz_visualisation.md index cfc131e94..b4e2cebfb 100644 --- a/docs/source/kedro-viz_visualisation.md +++ b/docs/source/kedro-viz_visualisation.md @@ -279,8 +279,8 @@ The `%run_viz` command supports various optional arguments found in `kedro viz r * `--host=`: Specify the server host. * `--port=`: Set the server port. -* `--load-file=`: Load a specific pipeline visualisation from a [directory](https://docs.kedro.org/projects/kedro-viz/en/stable/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). -* `--save-file=`: Save the current pipeline visualisation to a [directory](https://docs.kedro.org/projects/kedro-viz/en/stable/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). +* `--load-file=`: Load a specific pipeline visualisation from a [directory](https://docs.kedro.org/projects/kedro-viz/en/latest/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). +* `--save-file=`: Save the current pipeline visualisation to a [directory](https://docs.kedro.org/projects/kedro-viz/en/latest/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). * `--pipeline=`: Visualise a specific pipeline. * `--env=`: Set the environment for the visualisation. * `--autoreload`: Enable automatic reloading of the visualisation when source code changes. From 656dfdbbe509db7dc57838304dff78f1903f890d Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Thu, 28 Nov 2024 11:41:30 +0000 Subject: [PATCH 16/19] fix docs Signed-off-by: rashidakanchwala --- docs/source/cli-docs.md | 4 ++-- docs/source/kedro-viz_visualisation.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/cli-docs.md b/docs/source/cli-docs.md index a5e5b7fe2..a4c3b95b7 100644 --- a/docs/source/cli-docs.md +++ b/docs/source/cli-docs.md @@ -44,10 +44,10 @@ kedro viz run [OPTIONS] - Whether to open the Kedro Viz interface in the default browser. The browser will open if the host is `localhost`. Defaults to `True`. - `--load-file ` - - Path to load Kedro Viz data from a [directory](https://docs.kedro.org/projects/kedro-viz/en/latest/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline + - Path to load Kedro Viz data from a [directory](#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline - `--save-file ` - - Path to save Kedro Viz data to a [directory](https://docs.kedro.org/projects/kedro-viz/en/latest/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, the visualisation data will be saved to this path for later use. + - Path to save Kedro Viz data to a [directory](#kedro-viz-directory-structure-when-you-save-it-as-a-file). If provided, the visualisation data will be saved to this path for later use. - `--pipeline, -p ` - Name of the registered pipeline to visualise. If not set, the default pipeline is visualised. diff --git a/docs/source/kedro-viz_visualisation.md b/docs/source/kedro-viz_visualisation.md index b4e2cebfb..f734880fd 100644 --- a/docs/source/kedro-viz_visualisation.md +++ b/docs/source/kedro-viz_visualisation.md @@ -279,8 +279,8 @@ The `%run_viz` command supports various optional arguments found in `kedro viz r * `--host=`: Specify the server host. * `--port=`: Set the server port. -* `--load-file=`: Load a specific pipeline visualisation from a [directory](https://docs.kedro.org/projects/kedro-viz/en/latest/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). -* `--save-file=`: Save the current pipeline visualisation to a [directory](https://docs.kedro.org/projects/kedro-viz/en/latest/cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). +* `--load-file=`: Load a specific pipeline visualisation from a [directory](./cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). +* `--save-file=`: Save the current pipeline visualisation to a [directory](./cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). * `--pipeline=`: Visualise a specific pipeline. * `--env=`: Set the environment for the visualisation. * `--autoreload`: Enable automatic reloading of the visualisation when source code changes. From c20d8d80cef276d381835db7c146b799228f9af1 Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Thu, 28 Nov 2024 11:47:40 +0000 Subject: [PATCH 17/19] update myst_heading_anchors Signed-off-by: rashidakanchwala --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 20fa9b182..b8ae078b7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -54,7 +54,7 @@ exclude_patterns = [] source_suffix = {".rst": "restructuredtext", ".md": "markdown"} -myst_heading_anchors = 2 +myst_heading_anchors = 7 intersphinx_mapping = { "kedro": ("https://docs.kedro.org/en/stable/", None), From 7d3fc2087fc4312e650dfeea4519bca06f91e329 Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Thu, 28 Nov 2024 11:53:48 +0000 Subject: [PATCH 18/19] fix myst error Signed-off-by: rashidakanchwala --- docs/source/kedro-viz_visualisation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/kedro-viz_visualisation.md b/docs/source/kedro-viz_visualisation.md index f734880fd..66c9cf651 100644 --- a/docs/source/kedro-viz_visualisation.md +++ b/docs/source/kedro-viz_visualisation.md @@ -279,8 +279,8 @@ The `%run_viz` command supports various optional arguments found in `kedro viz r * `--host=`: Specify the server host. * `--port=`: Set the server port. -* `--load-file=`: Load a specific pipeline visualisation from a [directory](./cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). -* `--save-file=`: Save the current pipeline visualisation to a [directory](./cli-docs.html#kedro-viz-directory-structure-when-you-save-it-as-a-file). +* `--load-file=`: Load a specific pipeline visualisation from a [directory](./cli-docs.md#kedro-viz-directory-structure-when-you-save-it-as-a-file). +* `--save-file=`: Save the current pipeline visualisation to a [directory](./cli-docs.md#kedro-viz-directory-structure-when-you-save-it-as-a-file). * `--pipeline=`: Visualise a specific pipeline. * `--env=`: Set the environment for the visualisation. * `--autoreload`: Enable automatic reloading of the visualisation when source code changes. From 8d7dafc131d152012cb68a2415a044fd1ee3d2ac Mon Sep 17 00:00:00 2001 From: rashidakanchwala Date: Thu, 28 Nov 2024 12:09:45 +0000 Subject: [PATCH 19/19] add release notes Signed-off-by: rashidakanchwala --- RELEASE.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RELEASE.md b/RELEASE.md index 0772ea022..68e3f753f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -6,6 +6,15 @@ Please follow the established format: - Include the ID number for the related PR (or PRs) in parentheses --> +# Release 10.2.0 + + +## Major features and improvements + +## Bug fixes and other changes + +- Fix kedro viz `--load-file` to run from any directory without requiring a Kedro project. (#2206) + # Release 10.1.0 ## Major features and improvements @@ -17,6 +26,7 @@ Please follow the established format: ## Bug fixes and other changes + - Fix tag being undefined when pipeline are ordered differently (#2162, #2146) - Fix unserializable parameters value. (#2122) - Update kedro-viz lite banner icon and message. (#2196)