Complete the code to define a DAG with a daily schedule.
with DAG('data_pipeline', schedule_interval=[1], start_date=datetime(2024, 1, 1)) as dag:
The schedule_interval set to '@daily' runs the DAG once every day.
Complete the code to create a task that runs a Python function.
task = PythonOperator(task_id='process_data', python_callable=[1], dag=dag)
The python_callable argument expects a function reference without parentheses.
Fix the error in the task dependency definition.
task1 [1] task2The >> operator sets task1 to run before task2 in Airflow.
Fill both blanks to create a task that checks for a schema file before processing.
check_schema = [1](task_id='check_schema_file', filepath='schema.json', dag=dag) process = [2](task_id='process_data', python_callable=process_data, dag=dag)
FileSensor waits for the schema file, then PythonOperator runs the processing function.
Fill both blanks to create a dictionary comprehension that filters columns based on schema.
filtered_data = {col:val for col, val in data.items() if col [1] schema and val [2] None}The comprehension creates a dict with columns and values where the column is in the schema and value is not None.
