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

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz
Community Manager
Community Manager

Hi @Kibour

  • Ensure that the Databricks Repos feature is enabled. Sometimes, this issue arises when Repos are not properly activated.
  • Additionally, verify that Repos are allowed for DBR 8.4+ versions.
  • Confirm that your folder structure adheres to the correct path style (e.g., folder.subfolder.file).
  • Double-check that you’re using the full folder path when importing modules.
  • Make sure the files you’re trying to import are not notebook files but actual Python .py files.
  • Experiment with importing modules using sys.path. Ensure that the path to your repo is correctly added to sys.path.
  • If you’re importing within the same repo, try locating the module using relative paths.
  • Verify that your cluster version is DBR 9.1.
  • Confirm that you can use Git features and view/edit .py files successfully.

View solution in original post

2 REPLIES 2

Kaniz
Community Manager
Community Manager

Hi @Kibour

  • Ensure that the Databricks Repos feature is enabled. Sometimes, this issue arises when Repos are not properly activated.
  • Additionally, verify that Repos are allowed for DBR 8.4+ versions.
  • Confirm that your folder structure adheres to the correct path style (e.g., folder.subfolder.file).
  • Double-check that you’re using the full folder path when importing modules.
  • Make sure the files you’re trying to import are not notebook files but actual Python .py files.
  • Experiment with importing modules using sys.path. Ensure that the path to your repo is correctly added to sys.path.
  • If you’re importing within the same repo, try locating the module using relative paths.
  • Verify that your cluster version is DBR 9.1.
  • Confirm that you can use Git features and view/edit .py files successfully.

Kibour
Contributor

Hi @Kaniz ,

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