-
Notifications
You must be signed in to change notification settings - Fork 113
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
Fix Kedro Viz stays waiting even if no valid project was found #1793
Conversation
from kedro_viz.server import run_server | ||
|
||
project_path = Path.cwd() | ||
|
||
bootstrap_project(project_path) |
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.
This is fine but instead of showing an error stack trace, it would be nice to show a custom error message with the exception, something like -
# check if the project_path points to a valid Kedro Project
try:
bootstrap_project(project_path)
except Exception as exc:
display_cli_message(f"ERROR: Unable to start Kedro-Viz : {exc} ", "red")
return
@@ -158,7 +164,6 @@ def run( | |||
"extra_params": params, | |||
} | |||
if autoreload: | |||
project_path = Path.cwd() | |||
run_server_kwargs["project_path"] = project_path | |||
run_process_kwargs = { | |||
"path": project_path, |
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.
The above process calls run_server -> load_and_populate_data -> load_data
. In load_data
we again call bootstrap_project (line 91) which is a duplicate call. Though I like the idea of having bootstrap_project inside data_loader which makes sense considering it loads metadata, we need to remove this if we go by the approach in this PR. For the dev mode we already have bootstrap_project(project_path) in server.py -> main
at line 143
closing this for now. will work on this from #1796 |
Description
Resolves #1761
Development notes
Before we start running any of the viz processing, we first call the
bootstrap_project(project_path)
fromkedro.framework.startup
to ensure that we are runningkedro viz
run from a valid kedro project.QA notes
Checklist
RELEASE.md
file