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

kedro viz --load-file looks for project configurations. #2045

Closed
1 task
rashidakanchwala opened this issue Aug 19, 2024 · 0 comments · Fixed by #2206
Closed
1 task

kedro viz --load-file looks for project configurations. #2045

rashidakanchwala opened this issue Aug 19, 2024 · 0 comments · Fixed by #2206
Assignees

Comments

@rashidakanchwala
Copy link
Contributor

rashidakanchwala commented Aug 19, 2024

Description

kedro-viz --load-file looks for project configurations. Ideally it should be able to run directly using the json regardless if the Kedro project exists or not.

Raised by @noklam

Steps to Reproduce

  1. run kedro viz --save-file=file from demo-project directory
  2. run kedro viz --load-file=file from demo-project directory
  3. now go to parent directory and run `kedro viz --load-file = demo-project/file' and it will give you below error
Screenshot 2024-08-19 at 13 29 54

Expected Result

It shouldn't throw that bug.

Actual Result

Tell us what happens instead.

-- If you received an error, place it here.
-- Separate them if you have more than one.

Your Environment

Include as many relevant details as possible about the environment you experienced the bug in:

  • Web browser system and version:
  • Operating system and version:
  • NodeJS version used (if relevant):
  • Kedro version used (if relevant):
  • Python version used (if relevant):

Checklist

  • Include labels so that we can categorise your issue
@rashidakanchwala rashidakanchwala moved this to Backlog in Kedro-Viz Aug 19, 2024
@rashidakanchwala rashidakanchwala moved this from Backlog to Todo in Kedro-Viz Oct 14, 2024
@rashidakanchwala rashidakanchwala moved this from Todo to Backlog in Kedro-Viz Oct 14, 2024
@rashidakanchwala rashidakanchwala moved this from Backlog to Todo in Kedro-Viz Nov 11, 2024
rashidakanchwala added a commit that referenced this issue Nov 28, 2024
…ng a Kedro project (#2206)

This PR fixes #2045.

Previously, kedro viz --load-file checked if the command was run from within a Kedro project directory, which is not required. The fix ensures that kedro viz --load-file can run from anywhere as long as it has the correct path the API data directory .

The key behavior is now as follows:

If the specified filepath does not exist, a ValueError is raised:
ValueError: The provided filepath 'hellod' does not exist.
If the filepath exists but does not contain the expected directory structure (api/main, api/pipelines/, and api/nodes/), a FileNotFoundError is raised:
FileNotFoundError: [Errno 2] No such file or directory: '/path/to/xyz/api/main'

If the filepath exists and has the required api directory structure and conent, kedro viz --load-file runs successfully using the API JSON data.
@github-project-automation github-project-automation bot moved this from In Review to Done in Kedro-Viz Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
2 participants