Thomas d'Hooghe
08/28/2024, 11:53 AM.ipynb
files in VSCode when having access to the catalog without getting the below "_undefined name catalog"_ error? I now selected the python exec in my .venv
, but gives me this behavior.
Thanks a lot in advance 🙂Thomas d'Hooghe
08/28/2024, 12:02 PMuv run python -m ipykernel install --user name --kedro-env --display-name "Kedro Environment"
creates a kernel successfully which i can select, but still does not work unfortunatelyJuan Luis
08/28/2024, 12:46 PMYury Fedotov
08/28/2024, 1:19 PMkedro jupyter notebook
so that a session bootstraps catalog
, session
etc?Nok Lam Chan
08/28/2024, 1:55 PM%load_ext kedro.ipython
Nok Lam Chan
08/28/2024, 1:58 PM%load_ext kedro.ipython
as the top is an easier choice that always work.Nok Lam Chan
08/28/2024, 1:58 PMNok Lam Chan
08/28/2024, 2:05 PMNok Lam Chan
08/28/2024, 2:12 PMtypings/___builtins___.pyi
type stub.Juan Luis
08/28/2024, 2:37 PMThomas d'Hooghe
08/28/2024, 3:16 PMNok Lam Chan
08/28/2024, 3:17 PM> Developer reload window
Thomas d'Hooghe
08/28/2024, 3:19 PMThomas d'Hooghe
08/28/2024, 3:22 PM__builtins__.pyi
should be empty right?Nok Lam Chan
08/28/2024, 3:23 PMThomas d'Hooghe
08/28/2024, 3:23 PMNok Lam Chan
08/28/2024, 3:23 PMpyi
file before today😅Nok Lam Chan
08/28/2024, 3:24 PM_catalog_: str
_pipelines_: strI have this just to silent the error, but you should give it the proper type hint
Nok Lam Chan
08/28/2024, 3:24 PMfrom kedro.io.data_catalog import DataCatalog
from kedro.framework.project import _ProjectPipelines
catalog: DataCatalog
pipelines: _ProjectPipeliens
Thomas d'Hooghe
08/28/2024, 3:26 PMThomas d'Hooghe
08/28/2024, 3:26 PMThomas d'Hooghe
08/28/2024, 3:28 PMfrom kedro.framework.context import load_context
context = load_context('../')
catalog = context.catalog
but python does not agree
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'load_context' from 'kedro.framework.context'
(/Users/Thomas_dHooghe/repos/xxx/pricing-aa/.venv/lib/python3.12/site-packages/kedro/framework/cont
ext/__init__.py)
Nok Lam Chan
08/28/2024, 3:29 PMNok Lam Chan
08/28/2024, 3:31 PMruff
, the error of pylance disappear right after that. though, I have no idea if there are strong community consensus about the typing stub. But i know at least mypy
also respect https://github.com/python/typeshed, so I tend to think it's a ruff problem.