Google Professional Data Engineer Question 235
Select 4Google Cloud PlatformYou are a Data Engineer tasked with creating a new DAG in Cloud Composer to process data from a Google Cloud Storage bucket and load it into BigQuery daily. Which of the following steps are required to ensure the DAG is properly created and scheduled in Cloud Composer?
- A
Write a Python script defining the DAG structure, tasks, and dependencies.
- B
Save the Python script in the
dags/folder of the Cloud Composer environment. - C
Configure the DAG to use a cron expression for scheduling.
- D
Manually deploy the DAG to each worker node in the Cloud Composer environment.
- E
Install all Python dependencies in the
requirements.txtfile of the Cloud Composer environment.
Show answer and explanation
Correct answers: A, B, C, E
Explanation
To create and schedule a DAG in Cloud Composer, you must write a Python script to define the DAG, place it in the dags/ folder, configure its schedule, and ensure all Python dependencies are installed. Cloud Composer automatically detects and manages the deployment of DAGs across the environment, so manual deployment to worker nodes is not required.
- A. Correct.
Correct. A DAG in Cloud Composer is defined using Python code that specifies the structure, tasks, and dependencies.
- B. Correct.
Correct. Cloud Composer automatically detects DAGs placed in the
dags/folder of the environment. - C. Correct.
Correct. Scheduling in Cloud Composer requires defining a cron expression or other schedule parameter in the DAG code.
- D. Incorrect.
Incorrect. Deploying the DAG manually to each worker node is unnecessary as Cloud Composer automatically handles distribution.
- E. Correct.
Correct. To ensure that the DAG runs correctly, all required Python dependencies must be specified and installed via the
requirements.txtfile in the Cloud Composer environment.