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

Aayush

10/10/2023, 3:18 AM
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

marrrcin

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.
👍 1
m

Mo Bro

10/10/2023, 7:21 AM
In the projects I have seen a folder called utils is used for this purpose.
m

marrrcin

10/10/2023, 7:22 AM
That’s perfectly fine too
a

Aayush

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
m

Mo Bro

10/10/2023, 8:11 AM
from kedro.framework.context import load_context from your project.utils.helper import *
👍 1
a

Aayush

10/12/2023, 3:23 AM
thank you
K 1
🥳 1