Courseiva

PDE Maintaining and Automating Data Workloads Practice Question

A data engineer is migrating a Composer 1 environment to Cloud Composer 2 and notices that a DAG relying on a legacy operator for a deprecated service no longer works. The engineer wants a durable fix that keeps the pipeline running and avoids repeating this problem in future upgrades. Which action should be taken?

⚠ Common exam trap

The trap here is treating version pinning or vendoring deprecated code as a fix, when it only postpones the incompatibility.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Move the deprecated logic into a PythonOperator that calls the service's current client library, and add unit tests to validate the behaviour.

Replacing deprecated operators with a PythonOperator that calls the service's current client library removes reliance on unsupported code and keeps the DAG functional on Composer 2. Adding tests ensures the replacement behaves correctly and catches regressions during future upgrades, which is the durable, maintainable outcome the scenario asks for.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Downgrade the environment's Python version to match the requirements of the legacy operator.

    Why it's wrong here

    Changing the Python version to satisfy one deprecated operator can break other DAGs and provider packages that require newer Python runtimes. Cloud Composer 2 supports specific Python versions, and downgrading may not even be permitted. This trades one incompatibility for several others and does not provide a maintainable path forward.

  • ✓

    Move the deprecated logic into a PythonOperator that calls the service's current client library, and add unit tests to validate the behaviour.

    Why this is correct

    Replacing the removed operator with a PythonOperator that uses the service's supported client library removes the dependency on deprecated code and keeps the DAG working. Adding unit tests guards against regressions during future upgrades, giving a durable, maintainable solution rather than a temporary workaround.

  • ✗

    Pin the Composer 2 environment to the exact Airflow version that still includes the legacy operator and avoid upgrades.

    Why it's wrong here

    Pinning the Airflow version freezes the environment and prevents security patches and provider updates, and Cloud Composer 2 does not guarantee availability of every legacy operator. It defers rather than solves the incompatibility and creates long-term maintenance risk, so it is not a durable fix for the described problem.

  • ✗

    Copy the legacy operator's source into the DAGs folder so it is imported locally instead of from the provider package.

    Why it's wrong here

    Vendoring a deprecated operator copies its dependencies and any fragile assumptions into your environment, and it will still break when those underlying libraries change. It also bypasses provider maintenance, so security and compatibility fixes are lost. This is a short-term hack that increases long-term debt rather than a durable fix.

About these practice questions

This PDE question is part of Courseiva's 747-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Google Cloud exam blueprint

This PDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PDE exam.