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

Improve Jupyter workflow when configuration is broken #1590

Closed
datajoely opened this issue Jun 6, 2022 · 2 comments · Fixed by #1761
Closed

Improve Jupyter workflow when configuration is broken #1590

datajoely opened this issue Jun 6, 2022 · 2 comments · Fixed by #1761
Assignees
Labels
Issue: Feature Request New feature or improvement to existing feature

Comments

@datajoely
Copy link
Contributor

Description

Is your feature request related to a problem? A clear and concise description of what the problem is: "I'm always frustrated when ..."

Using the spaceflights demo on 0.18.1 if I open a kedro jupyter notebook session and write catalog.list() I will get the following:

image

If I break the catalog.yml file so that it is unparsable and run kedro catalog list (or any other command like kedro run I will get a helpful parse error in the terminal:

image

However, if I start a kedro jupyter notebook session in this state, I get no warning or messaging that Kedro is unable to create the catalog, session and other global variables. As a user I get this confusing state where the catalog is no longer available to me:

image

Context

Why is this change important to you? How would you use it? How can it benefit other users?

I think novice users can get stuck here with no direction as to why the catalog is not available.

Possible Implementation

Surface warning to the jupyter context, perhaps even make a dummy catalog, context, session objects available that expose the log message when called...

@datajoely datajoely added the Issue: Feature Request New feature or improvement to existing feature label Jun 6, 2022
@antonymilne
Copy link
Contributor

I like this suggestion 👍 Does the error message appear in the console where you run kedro jupyter notebook or nowhere at all?

We used to have some sort of startup_error variable, not sure what happened to it. We actually need to improve error handling in load_ipython_extension in general anyway, so it probably makes sense to consider this issue at the same time as that so we have a solution that makes sense. I'll try to figure out the best way to approach these would be.

@datajoely
Copy link
Contributor Author

I don't think so - this is what comes up in the 2nd run:

kedro jupyter notebook
2022-06-06 10:55:55,418 - kedro.framework.cli.hooks.manager - INFO - Registered CLI hooks from 1 installed plugin(s): kedro-telemetry-0.2.1
Jupyter kernel kedro_jupytertest already exists and will be used.
/Users/.../miniconda3/envs/kedro-temp/bin/python -m jupyter notebook --MultiKernelManager.default_kernel_name=kedro_jupytertest
[I 2022-06-06 10:55:59.524 LabApp] JupyterLab extension loaded from /Users/.../miniconda3/envs/kedro-temp/lib/python3.8/site-packages/jupyterlab
[I 2022-06-06 10:55:59.524 LabApp] JupyterLab application directory is /Users/.../miniconda3/envs/kedro-temp/share/jupyter/lab
[I 10:55:59.530 NotebookApp] Serving notebooks from local directory: /Users/.../Documents/projects/jupytertest
[I 10:55:59.530 NotebookApp] Jupyter Notebook 6.4.11 is running at:
[I 10:55:59.530 NotebookApp] http://localhost:8888/?token=7e16104fba399d8efa9d8700ad3e5cb9a0ce9b9bfd5e9fd1
[I 10:55:59.530 NotebookApp]  or http://127.0.0.1:8888/?token=7e16104fba399d8efa9d8700ad3e5cb9a0ce9b9bfd5e9fd1
[I 10:55:59.530 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:55:59.537 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///Users/.../Library/Jupyter/runtime/nbserver-5978-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=7e16104fba399d8efa9d8700ad3e5cb9a0ce9b9bfd5e9fd1
     or http://127.0.0.1:8888/?token=7e16104fba399d8efa9d8700ad3e5cb9a0ce9b9bfd5e9fd1
[W 10:56:01.358 NotebookApp] Kernel Provisioning: The 'local-provisioner' is not found.  This is likely due to the presence of multiple jupyter_client distributions and a previous distribution is being used as the source for entrypoints - which does not include 'local-provisioner'.  That distribution should be removed such that only the version-appropriate distribution remains (version >= 7).  Until then, a 'local-provisioner' entrypoint will be automatically constructed and used.
    The candidate distribution locations are: ['/Users/.../miniconda3/envs/kedro-temp/lib/python3.8/site-packages/jupyter_client-7.3.2.dist-info']
[I 10:56:05.564 NotebookApp] Kernel started: a2c15a7b-22ff-400d-85be-48d61a39bb74, name: kedro_jupytertest
[IPKernelApp] ERROR | No such comm target registered: jupyter.widget.control
[IPKernelApp] WARNING | No such comm: 18ba389e-4b85-471c-a2c1-c8e83a925b94
[W 10:56:18.898 NotebookApp] 404 GET /api/kernels/b3ffafb1-e8b3-404f-b08b-722f43d6bfcd/channels?session_id=4051ac1d7f0248a0b336e473cc59b596 (::1): Kernel does not exist: b3ffafb1-e8b3-404f-b08b-722f43d6bfcd
[W 10:56:18.909 NotebookApp] 404 GET /api/kernels/b3ffafb1-e8b3-404f-b08b-722f43d6bfcd/channels?session_id=4051ac1d7f0248a0b336e473cc59b596 (::1) 11.950000ms referer=None
[I 10:56:46.782 NotebookApp] Saving file at /notebooks/Untitled.ipynb
[W 10:57:23.951 NotebookApp] 404 GET /api/kernels/b3ffafb1-e8b3-404f-b08b-722f43d6bfcd/channels?session_id=4051ac1d7f0248a0b336e473cc59b596 (::1): Kernel does not exist: b3ffafb1-e8b3-404f-b08b-722f43d6bfcd
[W 10:57:23.952 NotebookApp] 404 GET /api/kernels/b3ffafb1-e8b3-404f-b08b-722f43d6bfcd/channels?session_id=4051ac1d7f0248a0b336e473cc59b596 (::1) 1.990000ms referer=None
[I 11:01:43.490 NotebookApp] Starting buffering for a2c15a7b-22ff-400d-85be-48d61a39bb74:8b65c945c8f74bd1a009a0cca76f1844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Feature Request New feature or improvement to existing feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants