Hello everyone.. i have several pipelines in my pr...
# questions
a
Hello everyone.. i have several pipelines in my project but i am using some common helper functions across all. I want to place this helper file in src folder and allow all the pipelines to import it. Does kedro have any setting configuration that helps me achieve this or should i set sys.path in order to get this done?
m
This is a question related to Python directly 🙂 If you put your “common helper functions” in a file in
src/<your package name>
then you will be able to import them anywhere in your pipelines.
đź‘Ť 1
m
In the projects I have seen a folder called utils is used for this purpose.
m
That’s perfectly fine too
a
@Mo Bro what import command are you using? in my case i am getting error module utils not found..
@marrrcin somehow i am getting module not found
i tried using utils folder and did import utils.helper ... and also tried placing helper.py in src/project/pipelines/ and tried import helper .. again did not work
m
from kedro.framework.context import load_context from your project.utils.helper import *
đź‘Ť 1
a
thank you
K 1
🥳 1