Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove kedro-viz backend server, fetch data directly instead #70

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

jitu5
Copy link
Contributor

@jitu5 jitu5 commented Aug 20, 2024

In this PR We introduced use of Kedro-Viz python package with some methods load_and_populate_data and get_kedro_project_json_data from kedro_viz.server and kedro_viz.api.rest.responses from Kedro-Viz python package.

As of now get_kedro_project_json_data is not yet implemented on Kedro-Viz side but once I will create PR for the same I will update here.
kedro-org/kedro-viz#2049

Dev Notes

To achieve direct use of get_kedro_project_json_data method and get Kedro project data we created a LSP command (kedro.getProjectData). This command will be called by frontend on user requested to open Viz Webview.

Signed-off-by: Jitendra Gundaniya <[email protected]>
@jitu5 jitu5 requested a review from noklam August 20, 2024 10:55
@jitu5 jitu5 self-assigned this Aug 20, 2024
@noklam
Copy link
Contributor

noklam commented Aug 20, 2024

'get_json_data' from 'kedro_viz.api.rest.responses'

Is this some local changes? I cannot find this in kedro-viz either.

@noklam
Copy link
Contributor

noklam commented Aug 20, 2024

Note:
To test this, clone kedro-viz and checkout feature/kedro-project-data to do editable install. @jitu5 How do I test this? Do I need a build.vsix as we haven't publish viz so we still need a custom version npm package?

@@ -553,6 +555,21 @@ def definition_from_flowchart(ls, word):
result = definition(LSP_SERVER, params=None, word=word)
return result

@LSP_SERVER.command("kedro.getProjectData")
def get_porject_data_from_viz(lsClient):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_porject_data_from_viz(lsClient):
def get_project_data_from_viz(lsClient: KedroLanguageServer):

@jitu5
Copy link
Contributor Author

jitu5 commented Aug 20, 2024

Note: To test this, clone kedro-viz and checkout feature/kedro-project-data to do editable install. @jitu5 How do I test this? Do I need a build.vsix as we haven't publish viz so we still need a custom version npm package?

For now, in this PR we used custom version of npm package.

@@ -83,6 +83,8 @@
)
from pygls.server import LanguageServer

from kedro_viz.server import load_and_populate_data
from kedro_viz.api.rest.responses import get_kedro_project_json_data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of now get_kedro_project_json_data is not yet implemented on Kedro-Viz

Would this force extension users to upgrade kedro-viz? Or does this only affect the extension environment?

@noklam noklam changed the title Kedro viz server removed remove kedro-viz backend server, fetch data directly instead Aug 20, 2024
@noklam noklam mentioned this pull request Aug 20, 2024
33 tasks
@noklam
Copy link
Contributor

noklam commented Aug 21, 2024 via email

@jitu5 jitu5 changed the title remove kedro-viz backend server, fetch data directly instead Remove kedro-viz backend server, fetch data directly instead Aug 21, 2024
@astrojuanlu
Copy link
Member

If we only need 2 functions from Viz, maybe another interim solution can be to duplicate them until we have a more modular backend?

@noklam
Copy link
Contributor

noklam commented Aug 22, 2024

@astrojuanlu Unfortunate those are not two small isolated util functions. Kedro Viz has it own internal structure of "Modular Pipeline", https://github.com/kedro-org/kedro-viz/blob/d171b50ba2f7f57b425d2545470c826b260758a2/package/kedro_viz/data_access/managers.py

This is all needed to generate the JSON file.

Base automatically changed from vizwebview to main August 23, 2024 11:56
@noklam noklam merged commit ff43122 into main Aug 28, 2024
1 of 2 checks passed
@noklam noklam deleted the viz/viz-py-package branch August 28, 2024 15:41
@noklam noklam mentioned this pull request Sep 2, 2024
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants