-
Notifications
You must be signed in to change notification settings - Fork 893
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.framework.context.context.KedroContextError with Kedro 0.17.0 #677
Comments
Hi @zoumdatascience, the error you're getting Have you registered the pipeline in See below as example:
|
Hi @MerelTheisenQB,
|
Hi @zoumdatascience , that looks good thanks for posting that. Could you just clarify what exactly the issue is you're having? I read your description above, but I'm not sure I follow what's going on. I've run these lines:
and they're fine, so I'm guessing your issues come from Flask? Can you
|
Hi @MerelTheisenQB, Thank you for your feedback, the code that I was not pointing to the correct path of the project, so the step by step debugging (as you suggested) helped me find the issue. So my final code is below:
Have a great week! |
I'm glad you found the solution! Can I close the issue now? |
Problem solved |
Hello, Probably a noob questions, but what is: Thanks! |
Hi @jacobweiss2305, this code adds the project src directory to |
Right, but is that a function built by kedro, is it some open source function, or did the user build it? I am able to recreate error so would like to apply this fix. Thank you for the quick response btw! |
It's built by kedro, you can use it by importing it like this |
Description
Short description of the problem here.
I kept facing the ModuleNotFoundError then came across this post about the similar issue.
Further after implementing the recommended solution (snipet below), I got this error:
_add_src_to_path(Path.cwd()/"src", Path.cwd())
context = load_context(path_to_project)
output = context.run()
Context
How has this bug affected you? What were you trying to accomplish?
I was trying to deploy the kedro application on Docker using flask API. But the error occured while implementing the Flask API
Steps to Reproduce
I created the python file containing my flask scripts with the useful imports.
Everything works fine while using the default route to test the Flask API
Everything breaks when I call the load_context(path_to_project) (snipet below)
@app.route('/run')
def run():
_add_src_to_path(Path.cwd()/"src", Path.cwd())
context = load_context(path_to_project)
output = context.run()
return output
Got the kedro.framework.context.context.KedroContextError with the following detail:
kedro.framework.context.context.KedroContextError: Failed to find the pipeline named 'default'. It needs to be generated and returned by the '_get_pipelines' function.
Expected Result
I should receive a JSON outpout showing: {"Model has a coefficient R^2 of 0.456."}
Actual Result
I face the error explained in step 2. [Call the run route]
Your Environment
Include as many relevant details about the environment in which you experienced the bug:
pip show kedro
orkedro -V
): kedro, version 0.17.0python -V
): Python 3.7.9The text was updated successfully, but these errors were encountered: