cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Only absolute paths are currently supported. Paths must begin with '/'

AxelM
New Contributor

I am facing the above issue when using the Python Databricks SDK. I retreive the job-definition by "

client.jobs.get()" and then try to create it on another workspace with
"client.jobs.create()"

Therefore the job-definition is correct and working fine on the source workspace. Also relative paths are mandatory, as I am using a Git Reference to target the Notebook




1 REPLY 1

mark_ott
Databricks Employee
Databricks Employee

The error "Only absolute paths are currently supported. Paths must begin with '/'" in the context of the Databricks Python SDK means that when creating a job, the notebook path you provide must be an absolute workspace path (like /Users/username/notebook) rather than a relative path or a Git reference.โ€‹

Explanation of the Issue

  • The Databricks Jobs API (used via client.jobs.create()) expects the notebook path in the job definition to be an absolute path in the Databricks workspace filesystem, not a Git URL or a relative path.โ€‹

  • Even if you're working with Git-linked notebooks, when defining a job, the "notebook_path" field must always use an absolute path that exists in the workspace (e.g., /Repos/username/repo-name/path/to/notebook).โ€‹

How to Fix

  • Make sure that when you migrate a job between workspaces, the notebook referenced in the job is present in the destination workspace, and specify its absolute path in the job definition.

  • If you're using Git integration, use the absolute workspace path of the notebook synced from Git, not the Git reference or a relative path.โ€‹

  • Example:

    python
    job_settings = { "notebook_task": { "notebook_path": "/Repos/username/repo-name/path/to/notebook" }, # other job settings... } client.jobs.create(**job_settings)

Note on CI/CD and Git References

  • If your workflow requires Git-based deployment (to keep test and production in sync), you must automate a step that pulls or syncs the notebooks from Git into the workspace and then reference those absolute paths in the job configuration.

  • At this time, the Databricks Jobs API does not support specifying jobs directly referencing a Git branch/tag/commit for the taskโ€”jobs work off workspace objects, not directly from Git links.โ€‹

Summary Table

Solution Step Details
Use absolute notebook paths Path must begin with '/', referencing the workspace location of the notebook
Sync notebooks from Git before deploy Ensure the needed notebook exists in the destination workspace
No direct Git refs in job creation The Jobs API does not accept Git refs/tagsโ€”only absolute workspace paths allowed
 
 

Following these steps should resolve the "Only absolute paths are currently supported" error when using the Databricks Python SDK to migrate or create jobs with notebooks.โ€‹