dab: add databricks-bundles package and Python resource loader #224
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The 375-line OrderedDict YAML generator is brittle. Modern DAB supports Python-defined resources via
databricks-bundlespackage.Design
Tasks
databricks-bundles>=0.295.0to[project.optional-dependencies] lakebundle/resources/__init__.pywithload_resources()databricks.ymlto ~20 lines (bundle name, targets, python entry point)dev/scripts/backends/databricks.pyto useload_resources()for validationdatabricks-cli>=0.18.0from depsStarting. Plan:
Complete. CI #105: 13/13 passed. Deploy #106: passed.
Created:
bundle/resources/__init__.py—load_resources()returns typedResourceswithadd_job,add_schema,add_volumeVariable(path="catalog", type=str)for catalog parameterizationPythonWheelTasktasks, 13 schemas, 1 volumeModified:
databricks.yml— 23 lines (was 278). Delegates topython.resources: [resources:load_resources]pyproject.toml— replaceddatabricks-cli>=0.18.0withdatabricks-bundles>=0.295.0databricks.pygenerator —emit()now produces minimal YAML, SQL only viasql=Trueflaggen_config.py— passessqlflag throughTests: 30 DAB tests (12 new Python resource tests)
✅ CI verified. Deploy verified.