https://kedro.org/ logo
#questions
Title
# questions
r

rajat paliwal

09/18/2023, 11:27 PM
Hello all, I have a run into a situation where I need to close the KedroSession from a node. Is there a way I can achieve that?
m

marrrcin

09/19/2023, 6:39 AM
You "need"? Why?
j

Juan Luis

09/19/2023, 6:50 AM
indeed @rajat paliwal, if you tell us a bit about your use case, it will be easier for us to help
n

Nok Lam Chan

09/19/2023, 9:49 AM
Version of Kedro?
r

Rajat Paliwal

09/19/2023, 8:01 PM
Apologies for delay in reply. @Nok Lam Chan the kedro version is 0.18.7 . @marrrcin , @Juan Luis I mentioned "need" because its a unique case where a Kedro pipeline instantiated using kedro session need to be closed if a certain condition is true. I am running pipelines by instantiating the kedro session in a notebook . One way I can end the session is by closing the session in the notebook itself but I was hoping to do it from a node in order to keep the notebook clean from adding such conditions. Hope this provides the context behind my query. Happy to answer any other questions.
m

marrrcin

09/20/2023, 7:03 AM
It seems to me like something might be wrong with your pipeline’s design if you need such behaviour 🤔 Anyway, you can just raise exception in a node and catch it above 🙂 (But it’s a really bad solution 🙈 🙈 🙈 )