Sunday
Dear Community!
I want to work in a serverless environment. I tried this code here a couple of weeks:
resources:
pipelines:
test_uv_etl:
name: test_uv_etl
catalog: ${var.catalog}
schema: ${var.schema}
serverless: true
root_path: '../src/test_uv_etl'
libraries:
- glob:
include: ../src/test_uv_etl/transformations/**
environment:
dependencies:
- --editable ${workspace.file_path}I really like it: it simply installs all libraries defined in the pyproject.toml. On top, it builds a wheel for the package specified in the pyproject.toml. I assume, that this also works for jobs.
Now, I saw this pretty new docu about serverless folders
Here the following code snippet is suggested:
resources:
jobs:
my_project_job:
name: my-project-job
environments:
- environment_key: project
spec:
project_environment: ../pyproject.toml
tasks:
- task_key: main
environment_key: project
spark_python_task:
python_file: ../src/main.pyI assume, that this also works for pipelines.
Pretty similar, but still not clear for me:
yesterday
Thanks for the follow-up. The table came from a one-row Lakeflow pipeline materialized view called editable_install_proof. The pipeline read the installed version with importlib.metadata and the editable flag from direct_url.json, then wrote them with the package name and a marker from the imported module. After the update, I ran this in SQL Editor with the pipeline’s catalog and schema selected:
SELECT package, version, marker, editable FROM editable_install_proof;
The Graph tab in the second screenshot is part of the Jobs run page. In Jobs & Pipelines, open Runs and click the run’s start time. Select Graph, then click a task to see its output. For a chart of the SQL results, use + Add visualization next to Table in the first screenshot.
Databricks lists Graph for both single-task and multi-task runs, with no separate preview switch. Free Edition includes serverless Jobs. My screenshot is from an Azure Databricks workspace, so if Graph is still missing on your run details page, it would help to know your edition and which page you’re on.
Shared Serverless in Git folders and the Jobs Project environment do require the Project-Scoped Shared Compute beta. A workspace admin can check for it under the profile menu > Previews. The Git folder editor also needs serverless environment version 5 or later. Databricks doesn’t guarantee this beta on Free Edition or on a free trial. If you don’t see Environment source > Project in the job task, use Standard with a versioned wheel.
For the editable test, I passed the source directory to --editable. It worked in the pipeline and the import failed in the standard serverless Jobs task I tested. The same task type imported a built Hatchling wheel successfully. I can’t tell from that test whether the editable failure is temporary. For a Jobs deployment today, I’d pin a versioned wheel.
In uv, [tool.uv] package = false tells uv sync to install the dependencies and skip installing the root project. You can still run uv build explicitly. In the Git folder editor with Shared Serverless, use Apply or %uv sync after editing dependencies. I haven’t verified what gets reused after a Git update or how the Jobs project-environment beta caches builds.
Databricks SQL Editor showing the installed pipeline package version and editable=true.
Databricks Jobs task showing the successful wheel import and the package marker.
Sunday
the editable install worked in an Azure serverless pipeline. I put --editable in environment.dependencies and the package metadata reported editable=true. In a standard serverless Jobs task, the same dependency entry led to ModuleNotFoundError. A wheel built from the same Hatchling project imported successfully.
For the Jobs project_environment beta, Databricks requires a build backend and a current uv.lock to install the project itself. In our dev workspace, both Jobs API routes asked for a base environment or version even with the preview on. That left the beta’s build and cache behavior unverified. Jobs project environments
Databricks caches pipeline dependencies during development. If you’re changing a dependency while iterating, declare it directly in the pipeline’s environment.dependencies. Pipeline dependency guidance
Databricks SQL Editor showing the installed pipeline package version and editable=true.
Databricks Jobs task showing the successful wheel import and the package marker.
Sunday
Thank you!
yesterday
hi @a_user12
Hi if your company manages libraries centrally then follwing will be method:
yesterday
How is that central? It seems to take an array from a DAB variable right?
10 hours ago
Hi @a_user12
you're right that the DAB variable itself is just an array. In our setup, though, we don't list all project dependencies in that array separately. Each project is built through CI/CD and published as a versioned package to Artifactory, with its dependencies defined by the project itself.
The DAB deployment then references that released package through our internal Artifactory, and its dependencies are resolved from there. So for us the separation is intentional: pyproject.toml defines/builds the project, CI/CD produces the released artifact, and the production DAB deploys that versioned artifact rather than installing the project directly from source.
yesterday
Thanks for the follow-up. The table came from a one-row Lakeflow pipeline materialized view called editable_install_proof. The pipeline read the installed version with importlib.metadata and the editable flag from direct_url.json, then wrote them with the package name and a marker from the imported module. After the update, I ran this in SQL Editor with the pipeline’s catalog and schema selected:
SELECT package, version, marker, editable FROM editable_install_proof;
The Graph tab in the second screenshot is part of the Jobs run page. In Jobs & Pipelines, open Runs and click the run’s start time. Select Graph, then click a task to see its output. For a chart of the SQL results, use + Add visualization next to Table in the first screenshot.
Databricks lists Graph for both single-task and multi-task runs, with no separate preview switch. Free Edition includes serverless Jobs. My screenshot is from an Azure Databricks workspace, so if Graph is still missing on your run details page, it would help to know your edition and which page you’re on.
Shared Serverless in Git folders and the Jobs Project environment do require the Project-Scoped Shared Compute beta. A workspace admin can check for it under the profile menu > Previews. The Git folder editor also needs serverless environment version 5 or later. Databricks doesn’t guarantee this beta on Free Edition or on a free trial. If you don’t see Environment source > Project in the job task, use Standard with a versioned wheel.
For the editable test, I passed the source directory to --editable. It worked in the pipeline and the import failed in the standard serverless Jobs task I tested. The same task type imported a built Hatchling wheel successfully. I can’t tell from that test whether the editable failure is temporary. For a Jobs deployment today, I’d pin a versioned wheel.
In uv, [tool.uv] package = false tells uv sync to install the dependencies and skip installing the root project. You can still run uv build explicitly. In the Git folder editor with Shared Serverless, use Apply or %uv sync after editing dependencies. I haven’t verified what gets reused after a Git update or how the Jobs project-environment beta caches builds.
Databricks SQL Editor showing the installed pipeline package version and editable=true.
Databricks Jobs task showing the successful wheel import and the package marker.
yesterday
Jobs run Graph showing the successful verify_package task. Click the task node to open its output.
yesterday
thx
still some open questions where we have to wait till beta is past 😉