-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
Signed-off-by: Jitendra Gundaniya <[email protected]>
Is this some local changes? I cannot find this in |
Signed-off-by: Jitendra Gundaniya <[email protected]>
Note: |
@@ -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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def get_porject_data_from_viz(lsClient): | |
def get_project_data_from_viz(lsClient: KedroLanguageServer): |
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 |
There was a problem hiding this comment.
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?
The story is slightly more complicated. Ideally, we will pin a version of
kedro viz and vendor it with the extension.
There is question whether we need to also vendor the relevant dependencies,
viz itself is too big and we have done a lot of work to optimise this. At
the moment we do not need a viz backend server but merely using the library
code to generates some JSON.
If we choose to ask user install viz, the minimum is this should not cause
any server panic. That is, for non flowchart users they should be able to
keep their workflow without forcing to install viz.
I will open a separate issue to make sure we sort out this before release
and test it properly.
Issues:
- [Decide to vendor kedro-viz or require user to install ](#72)
…On Tue, 20 Aug 2024 at 15:51, Juan Luis Cano Rodríguez < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In bundled/tool/lsp_server.py
<#70 (comment)>
:
> @@ -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
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?
—
Reply to this email directly, view it on GitHub
<#70 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AELAWL7ARK24NA37D5LUXXDZSNJXDAVCNFSM6AAAAABMZUNVV2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDENBYGI2DKOBTGA>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
If we only need 2 functions from Viz, maybe another interim solution can be to duplicate them until we have a more modular backend? |
Signed-off-by: Nok Lam Chan <[email protected]>
Remove lsClient from webview request
@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. |
In this PR We introduced use of Kedro-Viz python package with some methods
load_and_populate_data
andget_kedro_project_json_data
fromkedro_viz.server
andkedro_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.