-
Notifications
You must be signed in to change notification settings - Fork 913
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
e2e-test for %load_node magic #3528
Conversation
e2e test for Notebook is tricky because we don't have a way to execute notebook as Notebook. This may be due to some front-end logic happening in Jupyter side.
I think it's still valuable to keep an e2e-test, it would be easier to do this with |
Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
…o noklam/load-node-e2e Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
@@ -17,6 +17,7 @@ def split_data(data: pd.DataFrame, example_test_data_ratio: float) -> dict[str, | |||
The data and the parameters will be loaded and provided to your function | |||
automatically when the pipeline is executed and it is time to run this node. | |||
""" | |||
print("load_node executed successfully") |
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 an anchor statement so that the e2e test and ensure %load_node
is run properly without asserting the function definition.
kedro/ipython/__init__.py
Outdated
if local_namespace.get("context") and hasattr( | ||
local_namespace["context"], "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 an edge case where I run behave
and I get error, because there is a name collision where behave
using something also call context
in the local namespace.
This is a generic problem though rare.
Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
…o noklam/load-node-e2e Signed-off-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
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.
Left some small comments, but generally this looks like a good approach. Automatically testing jupyter notebooks has always been a bit weird, so I think it's fine to go with ipython instead.
features/steps/test_starter/{{ cookiecutter.repo_name }}/ipython_script.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
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.
Lgtm!
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.
Thanks @noklam ! ⭐
Description
The e2e test was not working due to subtle difference between running notebook programatically and from UI. This draft PR was the original tests that I created.
Development notes
Developer Certificate of Origin
We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a
Signed-off-by
line in the commit message. See our wiki for guidance.If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.
Checklist
RELEASE.md
file