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:ย 

Function not found when running from another Notebook using %run command.

jay_sharma
New Contributor III

Hi all,

I'm trying to run some functions from another notebook (data_process_notebook) in my main notebook, using the %run command command.

When I run the command: %run ../path/to/data_process_notebook, it is able to complete successfully, no path, permission or code errors. Since run command ran successfully, I'm assuming the functions have been defined correctly.

However later in my original notebook, I'm calling a function from the data_process_notebook.

I'm getting this error: "name 'myFunc' is not defined". I'm getting this output from the standard output logs from the driver.

I'm also running code from other notebooks, using the same %run command. I'm also calling the functions from these notebooks in my main notebook and they seem to be working fine.

I've re-started the cluster and I still get the same error.

Does anyone know how to resolve this? Would I have to copy the code from data_process_notebook into my main notebook in order to get it to run?

Thanks for the help

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group