From c985b55488d47e6d68eaf7f3fa72575d8dfe4b4a Mon Sep 17 00:00:00 2001 From: Nok Lam Chan Date: Thu, 19 Sep 2024 17:18:33 +0100 Subject: [PATCH 1/6] Expand pipeline search folders Signed-off-by: Nok Lam Chan --- CHANGELOG.md | 1 + bundled/tool/lsp_server.py | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7aa71c..3d3ffa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Fixed a bug where "Find reference" return too many matches for catalog dataset, it returns only exact matches now. - Fixed a bug where namespace dataset navigation is not working properly - Fixed a bug where navigating on nested parameters should go to the top level key. +- Modify the extension to search pipelines from all /pipelines folder. # 0.1.0 diff --git a/bundled/tool/lsp_server.py b/bundled/tool/lsp_server.py index 8d98eb2..3167b36 100644 --- a/bundled/tool/lsp_server.py +++ b/bundled/tool/lsp_server.py @@ -290,7 +290,9 @@ def _query_parameter(document, word=None): def _query_catalog(document, word=None): if not word: - word = document.word_at_position(params.position, RE_START_WORD, RE_END_WORD) + word = document.word_at_position( + params.position, RE_START_WORD, RE_END_WORD + ) catalog_paths = _get_conf_paths(server, "catalog") log_for_lsp_debug(f"Attempt to search `{word}` from catalog") log_for_lsp_debug(f"{catalog_paths=}") @@ -377,19 +379,15 @@ def references( pipelines_package = importlib_resources.files(f"{PACKAGE_NAME}.pipelines") - # Iterate on pipelines//**/*pipeline*.py + # Iterate on pipelines/**/*.py that fits both modular or flat pipeline structure. result = [] - for pipeline_dir in pipelines_package.iterdir(): - if not pipeline_dir.is_dir(): - continue - # Use glob to find files matching the pattern recursively - pipeline_files = glob.glob(f"{pipeline_dir}/**/*.py", recursive=True) - for pipeline_file in pipeline_files: - # Read the line number and match keywords naively - with open(pipeline_file) as f: - for i, line in enumerate(f): - if f'"{word}"' in line: - result.append((Path(pipeline_file), i)) + pipeline_files = glob.glob(f"{pipelines_package}/**/*.py", recursive=True) + for pipeline_file in pipeline_files: + # Read the line number and match keywords naively + with open(pipeline_file) as f: + for i, line in enumerate(f): + if f'"{word}"' in line: + result.append((Path(pipeline_file), i)) locations = [] if result: From dd66f317713562919250622be5f61584127d4ee8 Mon Sep 17 00:00:00 2001 From: Nok Lam Chan Date: Wed, 27 Nov 2024 17:05:41 +0800 Subject: [PATCH 2/6] release 0.2.3 Signed-off-by: Nok Lam Chan --- CHANGELOG.md | 10 +++++++++- package.json | 4 ++-- requirements.txt | 4 ++-- src/test/python_tests/requirements.txt | 4 ++-- webview/package-lock.json | 8 ++++---- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fff5c05..3cfd3de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +# 0.2.3 +## Major changes and new features +- Silenced the server initialisastion error when working on a non-kedro project. +- Improved UX when click on the visualisation it will not refocus every time. + +## Bug fix +- Fixed Windows path issue. + # 0.2.2 - Reduce size of packaged artifacts. @@ -11,7 +19,7 @@ - Integrated Kedro-Viz flowchart into the extension with a new command `Kedro: Run Kedro Viz`. - Modified the extension to search pipelines from all `/pipelines` folder. - Added new command `Kedro: Show Logs` - + ## Bug fix - `Select Environment` actions now update the run environment instead of base. - Modified status bar to show both environments, i.e.`base + local`, and `base` is no longer selectable. diff --git a/package.json b/package.json index edb7837..f2a96f0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "Kedro", "displayName": "Kedro", "description": "A Kedro VSCode Extension.", - "version": "0.2.2", + "version": "0.2.3", "preview": false, "serverInfo": { "name": "Kedro", @@ -194,4 +194,4 @@ "webpack": "^5.89.0", "webpack-cli": "^5.1.4" } -} +} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 98dbcca..b5a45d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ attrs==24.2.0 # via # cattrs # lsprotocol -cattrs==24.1.1 +cattrs==24.1.2 # via # lsprotocol # pygls @@ -16,7 +16,7 @@ exceptiongroup==1.2.2 # via cattrs lsprotocol==2023.0.1 # via pygls -packaging==24.1 +packaging==24.2 # via -r ./requirements.in pygls==1.3.1 # via -r ./requirements.in diff --git a/src/test/python_tests/requirements.txt b/src/test/python_tests/requirements.txt index 4efaf24..68446b5 100644 --- a/src/test/python_tests/requirements.txt +++ b/src/test/python_tests/requirements.txt @@ -8,7 +8,7 @@ exceptiongroup==1.2.2 # via pytest iniconfig==2.0.0 # via pytest -packaging==24.1 +packaging==24.2 # via pytest pluggy==1.5.0 # via pytest @@ -18,7 +18,7 @@ pytest==8.3.3 # via -r ./src/test/python_tests/requirements.in python-jsonrpc-server==0.4.0 # via -r ./src/test/python_tests/requirements.in -tomli==2.0.1 +tomli==2.1.0 # via pytest ujson==5.10.0 # via python-jsonrpc-server diff --git a/webview/package-lock.json b/webview/package-lock.json index 37391db..11b0d31 100644 --- a/webview/package-lock.json +++ b/webview/package-lock.json @@ -8,7 +8,7 @@ "name": "kedro-viz-Webview", "version": "0.0.1", "dependencies": { - "@quantumblack/kedro-viz": "^10.0.0", + "@quantumblack/kedro-viz": "^10.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-scripts": "5.0.1" @@ -4469,9 +4469,9 @@ } }, "node_modules/@quantumblack/kedro-viz": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@quantumblack/kedro-viz/-/kedro-viz-10.0.0.tgz", - "integrity": "sha512-jF85Z4/dE4YlhyFcAlhRJzw+k3N4gy2bkpKe0jnSRslRXh/Wfk9XsSsud0fJuzoRTtf6hBp2at+cin9qouATxw==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@quantumblack/kedro-viz/-/kedro-viz-10.1.0.tgz", + "integrity": "sha512-aoUC31NZLi4W8J8WiaV4wQFA5csv5GcWmFJEP/yULPkB2Gwr9RGO/3LY8Lfoitz9DMZ8KkHEHBtHakiaiAEg/Q==", "dependencies": { "@apollo/client": "^3.5.6", "@emotion/react": "^11.10.6", From 5adbc4f64f48b7bbaa44afc368d66f31f5bd1c84 Mon Sep 17 00:00:00 2001 From: Nok Lam Chan Date: Wed, 27 Nov 2024 17:20:58 +0800 Subject: [PATCH 3/6] Update the version number in the prompt Signed-off-by: Nok Lam Chan --- src/webview/createOrShowKedroVizPanel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webview/createOrShowKedroVizPanel.ts b/src/webview/createOrShowKedroVizPanel.ts index 59c3758..162ba46 100644 --- a/src/webview/createOrShowKedroVizPanel.ts +++ b/src/webview/createOrShowKedroVizPanel.ts @@ -23,7 +23,7 @@ export async function handleKedroViz( } else { const header = 'Kedro-Viz Dependency Required'; const options: vscode.MessageOptions = { - detail: 'Kedro-Viz version 10.0.0 or later is required to visualize your project\'s data pipeline. It’s not installed in your virtual environment. Click "Install" to set it up with pip.', + detail: 'Kedro-Viz version 10.0.1 or later is required to visualize your project\'s data pipeline. It’s not installed in your virtual environment. Click "Install" to set it up with pip.', modal: true, }; From fb9ce368232f784adc860cc073d59f0ddaf3a563 Mon Sep 17 00:00:00 2001 From: Nok Lam Chan Date: Wed, 27 Nov 2024 17:25:44 +0800 Subject: [PATCH 4/6] typo Signed-off-by: Nok Lam Chan --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cfd3de..b895efa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # 0.2.3 ## Major changes and new features -- Silenced the server initialisastion error when working on a non-kedro project. +- Silenced the server initialisation error when working on a non-kedro project. - Improved UX when click on the visualisation it will not refocus every time. ## Bug fix From e9a319003355815562fc77427544342c7f5c2df0 Mon Sep 17 00:00:00 2001 From: Nok Lam Chan Date: Wed, 27 Nov 2024 18:01:01 +0800 Subject: [PATCH 5/6] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Juan Luis Cano Rodríguez --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b895efa..a482de3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # 0.2.3 ## Major changes and new features -- Silenced the server initialisation error when working on a non-kedro project. +- Silenced the server initialisation error when working on a non-Kedro project. - Improved UX when click on the visualisation it will not refocus every time. ## Bug fix From 3cdba0076925dac1a0ec957c39b7a681e0fd9767 Mon Sep 17 00:00:00 2001 From: Nok Lam Chan Date: Thu, 28 Nov 2024 17:01:52 +0800 Subject: [PATCH 6/6] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Juan Luis Cano Rodríguez --- CHANGELOG.md | 2 +- src/webview/createOrShowKedroVizPanel.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a482de3..2d7d944 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ # 0.2.3 ## Major changes and new features - Silenced the server initialisation error when working on a non-Kedro project. -- Improved UX when click on the visualisation it will not refocus every time. +- Improved UX: when clicking on the visualisation it will not refocus every time. ## Bug fix - Fixed Windows path issue. diff --git a/src/webview/createOrShowKedroVizPanel.ts b/src/webview/createOrShowKedroVizPanel.ts index 162ba46..049e1c0 100644 --- a/src/webview/createOrShowKedroVizPanel.ts +++ b/src/webview/createOrShowKedroVizPanel.ts @@ -23,7 +23,7 @@ export async function handleKedroViz( } else { const header = 'Kedro-Viz Dependency Required'; const options: vscode.MessageOptions = { - detail: 'Kedro-Viz version 10.0.1 or later is required to visualize your project\'s data pipeline. It’s not installed in your virtual environment. Click "Install" to set it up with pip.', + detail: 'Kedro-Viz version 10.1.0 or later is required to visualize your project\'s data pipeline. It’s not installed in your virtual environment. Click "Install" to set it up with pip.', modal: true, };