cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Bizarre Delta Tables pipeline error: ModuleNotFound

Geoff
New Contributor II

I received the following error when trying to import a function defined in a .py file into a .ipynb file. I would add code blocks, but the message keeps getting rejected for invalid HTML.

# test_lib.py (same directory, in a subfolder)
def square(x):
return x * x

# dlt_pipeline.ipynb
import dlt
import sys
import os
from pathlib import Path
sys.path.append(os.path.abspath('..'))
from pyspark.sql.functions import expr
from test_lib import square # Error is here

ModuleNotFoundError: No module named 'test_lib',None,Map(),Map(),List(),List(),Map())

I was using Asset Bundles when this occurred. The error makes no sense to me because (1) I can import that function when I run the .ipynb file locally, or even when I manually run it on DB using my personal cluster, and (2) the ',None,Map(),Map(),List(),List(),Map()' at the end seems to come from nowhere. Any help in solving this would be very much appreciated. Thank you!

0 REPLIES 0

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now