From e49cfa50a9eddc1e45dd6e1151bbd58f5088df0f Mon Sep 17 00:00:00 2001 From: Jitendra Gundaniya <38945204+jitu5@users.noreply.github.com> Date: Fri, 22 Nov 2024 10:32:06 +0000 Subject: [PATCH] Update `get_kedro_project_json_data` import path (#152) * get_kedro_project_json_data path update Signed-off-by: Jitendra Gundaniya * Updated the minimum version of kedro-viz to 10.1.0 Signed-off-by: Jitendra Gundaniya --------- Signed-off-by: Jitendra Gundaniya --- bundled/tool/lsp_server.py | 7 ++++++- kedro-viz-requirements.txt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bundled/tool/lsp_server.py b/bundled/tool/lsp_server.py index ef78eda..a88f999 100644 --- a/bundled/tool/lsp_server.py +++ b/bundled/tool/lsp_server.py @@ -569,7 +569,12 @@ def definition_from_flowchart(ls, word): def get_project_data_from_viz(lsClient): """Get project data from kedro viz""" from kedro_viz.server import load_and_populate_data - from kedro_viz.api.rest.responses import get_kedro_project_json_data + try: + # For kedro-viz > 10.0.0 + from kedro_viz.api.rest.responses.pipelines import get_kedro_project_json_data + except ImportError as e: + # For kedro-viz = 10.0.0 + from kedro_viz.api.rest.responses import get_kedro_project_json_data data = None try: diff --git a/kedro-viz-requirements.txt b/kedro-viz-requirements.txt index 72a6deb..8ff9c5b 100644 --- a/kedro-viz-requirements.txt +++ b/kedro-viz-requirements.txt @@ -1 +1 @@ -kedro-viz>=10.0.0 +kedro-viz>=10.1.0