Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Configure and package Databricks Asset Bundles

A worked example

Yes or no

A team keeps a bundle project in the folder layout shown in the exhibit. The root databricks.yml file contains this mapping:

include:
  - resources/*.yml

The file resources/ingest_job.yml defines a job with a notebook task. That task sets notebook_path: ./notebooks/ingest.py.

The team now wants to add a second job and to write its definition in Python. It does not want to rewrite the existing YAML job.

sales-bundle/ ├── databricks.yml ├── resources/ │ └── ingest_job.yml └── notebooks/ └── ingest.py

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

StatementYesNo
The job in resources/ingest_job.yml must be moved into databricks.yml before the bundle can deploy it.

Configuration can be split into separate files, and the include mapping in databricks.yml (resources/*.yml) brings ingest_job.yml into the bundle. The job does not need to move.

Correct
In resources/ingest_job.yml, the path ./notebooks/ingest.py refers to the file sales-bundle/notebooks/ingest.py.

Task paths are relative to the configuration file that declares them. ingest_job.yml is in the resources folder, so ./notebooks/ingest.py points inside resources. The correct path to the notebook would be ../notebooks/ingest.py.

Correct
The team can define the new job in Python and keep the existing YAML job by adding a python section to databricks.yml.

Resources defined in Python can coexist with resources defined in YAML. An existing YAML bundle is extended by adding a python section to databricks.yml, and the virtual environment must contain the databricks-bundles package.

Correct
Why

A bundle can split its configuration across several YAML files that are referenced with the include mapping. Paths in each file are resolved from that file's own location, so a task declared in resources/ must go up one level to reach the notebooks folder. Python support lets the team add Python-defined resources next to the existing YAML ones by adding a python section to databricks.yml.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free