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?
10/10/2023, 7:18 AM
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.
10/10/2023, 7:21 AM
In the projects I have seen a folder called utils is used for this purpose.
10/10/2023, 7:22 AM
That’s perfectly fine too
10/10/2023, 7:45 AM
@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
10/10/2023, 8:11 AM
from kedro.framework.context import load_context
from your project.utils.helper import *