Skip to content

Data Engineer Professional · Domain 1: Developing Code for Data Processing using Python and SQL · 23% of the exam

Task 1.1: Implement scalable Python project structures for Declarative Automation Bundles (formerly Databricks Asset Bundles / DABs) to support modular development and CI/CD integration.

Splitting a bundle into included resource files, a src package built as a wheel artifact, Python-defined resources, templates, and a layout that lets CI validate and test each part.

Study it

  • Bundle project layout: includes, a src package, wheel artifacts and Python resources

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the Databricks documentation page that proves it.

Question 1 · choose 1

A bundle builds the shared package in src/ as a wheel through an artifacts entry of type whl and installs it as a dependency of several serverless job tasks. After a bug fix is merged and the bundle is deployed again, the serverless tasks still run the old code. The version in pyproject.toml is still 0.1.0, and the team does not want to edit it by hand on every merge. What should they change?

  1. AAdd sync: include for the dist folder of built wheels
  2. BSet dynamic_version: true on the whl artifact
  3. CRun databricks bundle deploy with the --force flag
  4. DSwitch the target to mode: development
Show the answer and why
  • AAdd sync: include for the dist folder of built wheels

    Incorrect

    The artifacts build already uploads the built wheel on deploy; the file reaches the workspace, but with an unchanged version the serverless environment keeps using the package it already has.

  • BSet dynamic_version: true on the whl artifact

    Correct

    Serverless jobs only pick up a changed custom package when its version changes; dynamic_version patches the wheel version from the file's timestamp on each deploy, so no manual version bump is needed.

  • CRun databricks bundle deploy with the --force flag

    Incorrect

    --force overrides Git branch validation; re-uploading a wheel with the same version still does not make serverless install the new code.

  • DSwitch the target to mode: development

    Incorrect

    Development mode changes names, schedules and concurrency for the target; it does not change how serverless decides to reinstall a package with the same version.

Serverless environments cache installed dependencies, and the serverless environment page notes that a changed custom package must also get a new version number for jobs to use it. The artifacts dynamic_version setting (or the artifacts_dynamic_version preset) makes the bundle patch the wheel version automatically on every deployment.

Question 2 · choose 1

A bundle's databricks.yml has grown to 2,000 lines of job and pipeline definitions. The team wants one YAML file per resource under resources/ while keeping a single bundle. How are those files made part of the bundle?

  1. AList them, or a glob such as resources/*.yml, in the include mapping
  2. BGive each resource file its own databricks.yml in a subfolder of resources/
  3. CAdd the folder to the sync include list so that the files are uploaded
  4. DPass each file with a separate -t option to databricks bundle deploy
Show the answer and why
  • AList them, or a glob such as resources/*.yml, in the include mapping

    Correct

    databricks.yml can reference other configuration files through the include mapping, so resource files can live in their own folder.

  • BGive each resource file its own databricks.yml in a subfolder of resources/

    Incorrect

    A bundle has one and only one databricks.yml, at the root of the bundle project.

  • CAdd the folder to the sync include list so that the files are uploaded

    Incorrect

    sync controls which files are uploaded to the workspace; it does not load configuration from them.

  • DPass each file with a separate -t option to databricks bundle deploy

    Incorrect

    -t selects a target defined in the configuration; it does not add configuration files.

A bundle must contain exactly one databricks.yml at its root. That file can reference other configuration files, such as resource files, through the include mapping, which accepts paths and globs.

Question 3 · choose 1

A team wants to define some of its jobs in Python code next to the YAML resources of an existing bundle. The Python files are in a resources package with a function that returns the jobs. What else does the bundle need so that deployment picks up these jobs?

  1. AA notebook task that imports the resources package and calls that function after each deploy
  2. BAn artifacts entry of type whl that builds the resources package on deploy
  3. CA python section in databricks.yml naming the function, with databricks-bundles installed
  4. DA rename of the Python files to .yml so that include can match them
Show the answer and why
  • AA notebook task that imports the resources package and calls that function after each deploy

    Incorrect

    Resources must be defined at deployment time by the CLI, not by a job that runs after deployment.

  • BAn artifacts entry of type whl that builds the resources package on deploy

    Incorrect

    Artifacts build files to deploy; they do not make the CLI load resource definitions from Python.

  • CA python section in databricks.yml naming the function, with databricks-bundles installed

    Correct

    The CLI calls the functions listed under python.resources during deployment, using the virtual environment that has the databricks-bundles package.

  • DA rename of the Python files to .yml so that include can match them

    Incorrect

    Renaming the files does not turn Python code into valid YAML configuration.

Python support for bundles loads resources through functions listed under python.resources in databricks.yml. The specified virtual environment must contain the databricks-bundles package. Python and YAML resources can coexist.

Question 4 · choose 1

In a team's CI pipeline, an earlier step builds and tests the project wheel into dist/. The bundle deploy step must upload and use that exact wheel rather than build it again. How should the bundle be configured?

  1. AKeep an artifacts entry of type whl with build set to the same build command
  2. BOmit the artifacts mapping and reference ./dist/*.whl in the task's libraries
  3. CSet dynamic_version to true so that the CLI skips the build step
  4. DUpload the wheel to the DBFS root and point the task's libraries at the dbfs:/ path
Show the answer and why
  • AKeep an artifacts entry of type whl with build set to the same build command

    Incorrect

    A build command runs locally before each deployment, which builds the wheel again instead of using the tested one.

  • BOmit the artifacts mapping and reference ./dist/*.whl in the task's libraries

    Correct

    Without an artifacts mapping, the CLI assumes the wheel is already built and deploys the files named in the libraries whl entries.

  • CSet dynamic_version to true so that the CLI skips the build step

    Incorrect

    dynamic_version does not skip a build; the artifacts entry still builds the wheel.

  • DUpload the wheel to the DBFS root and point the task's libraries at the dbfs:/ path

    Incorrect

    Storing libraries in the DBFS root is deprecated and disabled by default on current runtimes.

If the wheel is already built, leave out the artifacts mapping. The CLI then deploys the wheel files listed in the libraries array's whl entries.

Question 5 · choose 1

A data engineer starts a new Python project that will be deployed as a bundle. They want a ready-made layout with databricks.yml, a resources folder, a src package built as a wheel and a tests folder. Which command creates it?

  1. Adatabricks bundle validate run in an empty project folder
  2. Bdatabricks bundle generate job --existing-job-id for a job
  3. Cdatabricks bundle deploy with a new target name
  4. Ddatabricks bundle init with the default-python template
Show the answer and why
  • Adatabricks bundle validate run in an empty project folder

    Incorrect

    validate checks an existing bundle configuration; it does not create one.

  • Bdatabricks bundle generate job --existing-job-id for a job

    Incorrect

    generate writes configuration for an existing workspace resource; it does not scaffold a project.

  • Cdatabricks bundle deploy with a new target name

    Incorrect

    deploy needs an existing bundle; it does not create project files.

  • Ddatabricks bundle init with the default-python template

    Correct

    The default-python template generates databricks.yml, resource files, a src package with wheel build settings and sample unit tests.

databricks bundle init creates a bundle from a template. The default-python template lays out databricks.yml, resources, a src package and tests.

Practice domain 1 →Practice all domains →