Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 01:05 PM
I want to import a Python function stored in the following file path:
`<repo>/lib/lib_helpers.py`
I want to import the function from any file in my repo. For instance from these:
`<repo>/notebooks/etl/bronze/dlt_bronze_elt`
`<repo>/workers/job_worker`
It is possible to get the root path of the repo? This way people on my team can clone the repo but the paths will still work. I think I want the import code to look something like this:
repo_root = <<call to get the root of the Databricks Repo>>
sys.path.append(os.path.abspath(f'{repo_root}/lib/'))
from lib_helpers import helper_funcI am still new to Databricks. Does dbutils or another util help with this?
Labels:
- Labels:
-
Python Function