Hi everyone, I have to call Kedro nodes or pipelin...
# questions
p
Hi everyone, I have to call Kedro nodes or pipelines in my Django project. eg: for simulation ,we need to call kedro pipeline and want to use its output as input of django apis. please suggest some solution for this.
d
two ways come to mind 1. You use the Kedro code API to run things directly 2. You use Kedro in an isolated fashion where you write to a SQL table at the end and read that in on the Django side natively
p
its a run time calculation, I have to read pickel file every time on click event from UI.For this I need to call kedro pipeline in django API .Is it possible?
i can't use 2nd approch becz of above mentioned issue .
d
so then option 1 is your friend
so you can create a session like this
p
will u pls help me more with 1st option.I m not able to find anything related to that.
d
just bootstrap the project at the right path
and then the
session.run
method takes all the arguments available via the
kedro run
cli command
and then it will also return any terminal datasets
known as ‘free outputs’
i.e. don’t have any downstream uses
p
i have to call pipeline in a function of django,can't call through cli.
d
the bootstrap mechansim finds all registered pipelines in the directory structure
p
is there anyway through which i can directly call nodes in django function and store its output in a variable?
d
I’ve just done a quick search of GitHub and here is an example of someone doing this in a fastapi app https://github.com/hugosousa111/kedro_automobile_project/blob/4f36bcd6c6ea91f3c84794dd7dabd62c0e0bf84e/app.py#L244 The concepts should be the same