Home / DE Associate practice test / Implementing CI/CD / Question

Databricks Data Engineer Associate · free practice question

A team's PySpark transformation logic is factored into pure functions. On every pull request, a CI runner must execute a pytest suite against those functions…

Exam-style question on Implementing CI/CD from the free DE Associate practice test, with the answer and a full explanation below.

Updated November 10, 2026

Implementing CI/CD

A team's PySpark transformation logic is factored into pure functions. On every pull request, a CI runner must execute a pytest suite against those functions quickly and cheaply, without provisioning any Databricks cluster. Which approach best fits this CI step?

  1. AConfigure the CI runner to attach to a running all-purpose cluster in the workspace and execute pytest there, because PySpark transformation code can only ever be exercised meaningfully against a live Databricks cluster.
  2. BHave the CI job deploy the asset bundle to a staging workspace first and then trigger a Databricks job that runs the pytest suite, since transformation tests must always execute inside an already deployed workspace.
  3. CSkip unit tests for the transformation functions and rely only on integration tests that run after deployment, because notebook-based PySpark logic simply cannot be exercised by any purely local pytest run at all.
  4. DHave the CI pipeline provision a fresh job cluster for each pull request and submit the pytest suite to it, because creating a Spark session for the tests always requires a Databricks-managed cluster to be running.
  5. ERun pytest on the CI runner using Databricks Connect or a local SparkSession, so the pure transformation functions execute against Spark locally and no Databricks cluster is provisioned for this whole test step at all.
Answer & explanation

Correct answer: E

WHY E: Pure PySpark transformation functions can be exercised with pytest on the CI runner via Databricks Connect or a local SparkSession, needing no Databricks cluster for the test step. WHY NOT A: unit tests of pure functions do not require attaching to a live all-purpose cluster; a local Spark session suffices. WHY NOT B: deploying to a staging workspace first is an integration step, not a prerequisite for fast local unit tests. WHY NOT C: transformation logic factored into functions is unit-testable locally, so the claim that it cannot be is false. WHY NOT D: provisioning a job cluster per PR is slow and unnecessary because the tests run against a local Spark session.

Take the full DE Associate practice test free →

Would you pass today?

This question is one of 45 in the free, timed Databricks Data Engineer Associate practice test. Take it and get a section-by-section score.

Start the free test →