-
Notifications
You must be signed in to change notification settings - Fork 903
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
[KED-1581] Add on_pipeline_error and on_node_error methods to hooks #329
Comments
Hi @Galileo-Galilei, thank you for raising this and thank you for the initial work on the plugin. It looks very promising. So happy to see traction on this. Regarding your feature request, I agree that all the existing hooks only take into account the happy paths. I'm inclined to agree that a hook for Once we confirm the use cases, we will discuss internally to see whether to make this hook available or whether there is a better way to solve your use case that we haven't thought of yet. |
Hello @limdauto, I actually do not have real use cases for
I am not sure these use cases should be supported, they seem rather hacky. My original idea to introduce |
@Galileo-Galilei We have just merged these two hooks into develop. Thank you very much for the suggestion. It should go out with |
Description
I have tried the hooks implementation described which is part of #219. It works very smoothly, but I feel that it would be nice to have a method to deal with errors which may occurs during the execution between two hooks call.
Context
By now, hooks work by calling two methods (```before_WHATEVER
and
after_WHATEVER``) which frame the code line they should wrap. In case this code line fails, the user does not have a proper to end a behaviour that was triggered by the ``begin_WHATEVER`` function.A typical example is in #113 : if a mlflow run is started before a pipeline call, you want to be able to close it whatever even if the pipeline fails to avoid unintended side effects (further code execution will be logged in the current mlflow runs without any user warning)
Possible Implementation
Add a hook_spec where it fits (before the following line?)
https://github.com/quantumblacklabs/kedro/blob/e377bd5114b68caf236fa9f4c924bf58291efa9c/kedro/hooks/specs.py#L157-L158
and adjust the following call from this :
https://github.com/quantumblacklabs/kedro/blob/8bfa0a8ce0e3bef194ba8d4ca682becf8accdc24/kedro/context/context.py#L637-L646
to this:
The text was updated successfully, but these errors were encountered: