DLT - Importing Python Package

YS1
Contributor

Hello,

I'm creating a DLT pipeline where I read a Kafka stream, perform transformations using UDFs, and save the data in multiple tables. When I define the functions directly in the same notebook, the code works fine. However, if I move the code into a Python file and try to import it as a package, the pipeline fails with the following error:

YS1_1-1723071739598.png

I've tried renaming the files and changing their locations -although the pipeline and the package are in the same directory-

Despite these efforts, nothing worked. Here is how I'm trying to import the module:

YS1_0-1723071683421.png

Any insights or solutions would be greatly appreciated!