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: 

Import from repo

Kibour
Contributor

Hi all,

I am trying the new "git folder" feature, with a repo that works fine from the "Repos". In the new folder location, my imports from my own repo don't work anymore. Anyone faced something similar?

Thanks in advance for sharing your experience

2 ACCEPTED SOLUTIONS

Accepted Solutions

Kibour
Contributor

Hi @Retired_mod ,

Thanks for all the suggested options.

I tried again with a brand new git folder. I just changed cluster from DBR 14.2 ML to 14.3 ML, and now the imports work as expected.

Kind regards

View solution in original post

nicole_lu_PM
Databricks Employee
Databricks Employee

Hi from the Git folder product manager - 

If you use DBR 14.3+, the Git folder root is automatically added to the Python `sys.path`. This is documented here. 

Unfortunately we could not backport this behavior to earlier DBR versions. Hope this helps! 

 

 

 

View solution in original post

3 REPLIES 3

Kibour
Contributor

Hi @Retired_mod ,

Thanks for all the suggested options.

I tried again with a brand new git folder. I just changed cluster from DBR 14.2 ML to 14.3 ML, and now the imports work as expected.

Kind regards

nicole_lu_PM
Databricks Employee
Databricks Employee

Hi from the Git folder product manager - 

If you use DBR 14.3+, the Git folder root is automatically added to the Python `sys.path`. This is documented here. 

Unfortunately we could not backport this behavior to earlier DBR versions. Hope this helps! 

 

 

 

Yuki
New Contributor II

Hello,

When I had the same issue even using 14.3+, I tried this codes.

```python

import sys
import pprint

pprint.pprint(sys.path)
```
And I noticed that the path was throwed by old(Legacy) Repos folder. I managed the same name of the folder & Repos.
Then I removed old Repos folder, then it has work.

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