Professional Data Engineer Practice Questions

Google Cloud Professional Data Engineer exam preparation

Professional Data Engineer practice questions in English: 180 questions with explanations. The mock exam has 50 questions and 120 minutes.

Professional Data Engineer free question 5 / 10 · Domain 2: Ingesting and processing the data

A CI/CD pipeline tests the DAGs in a GitHub repository with Cloud Build and syncs them to a Managed Airflow development environment (Cloud Composer on earlier pages and in the Exam Guide). Which statement matches the example on the page "Test, synchronize, and deploy your DAGs from GitHub"?

  1. The packages that the presubmit unit tests use are read from the environment by Cloud Build, so that they match the Managed Airflow development environment
  2. The presubmit trigger is created with the event set to Pull Request and the base branch set to ^main$
  3. If you set Comment Control to not required on the presubmit trigger, the repository administrator chooses which pull requests start a build
  4. The steps in the presubmit configuration file are two: install the DAG dependencies and run the DAG tests, with the unit-test dependencies installed together with the DAG dependencies
Show the answer and explanation

Answer: B

Why this is correct
The section "Create the Cloud Build trigger for the presubmit check" says you create the presubmit trigger as a trigger based on the GitHub app, with the name test-dags, the event Pull Request, the source base branch ^main$ (changed to match the name of the repository's base branch), and the configuration file /test-dags.cloudbuild.yaml. A pull request to the main branch starts a build, and Cloud Build runs the DAG unit tests to check that the DAGs are valid.

Why the other options are wrong
"If you set Comment Control to not required on the presubmit trigger, the repository administrator chooses which pull requests start a build" … The section warns that if you set Comment Control to not required, any user can submit a pull request that starts a build, and it recommends making Comment Control required for large repositories or repositories with untrusted contributors.
"The steps in the presubmit configuration file are two: install the DAG dependencies and run the DAG tests, with the unit-test dependencies installed together with the DAG dependencies" … The section "Create Cloud Build YAML configuration for the presubmit check" says test-dags.cloudbuild.yaml has three steps: install the dependencies the DAGs need, install the dependencies the unit tests need, and run the DAG tests. The unit-test dependencies are installed in a separate step from requirements-test.txt.
"The packages that the presubmit unit tests use are read from the environment by Cloud Build, so that they match the Managed Airflow development environment" … The section "Run a presubmit job" says Cloud Build runs the unit tests with the packages listed in requirements.txt and requirements-test.txt (including the public version of Airflow), so the set of packages can differ from that of a Managed Airflow environment, and it recommends running a local Airflow environment while you develop DAGs. The packages are not read from the environment.

Key point
The first Cloud Build job is the presubmit check, which runs the DAG unit tests. Unit tests carry the _test suffix and live in the same repository as the DAGs. After the sync job sends the DAGs to the development environment, you check them there, and if they behave as expected, you upload the DAG files by hand to dags/ in the production environment's bucket.

Go to the Professional Data Engineer practice app (10 free questions; purchase unlocks all questions)

See the full practice set