Complete the code to set the database connection URI in Airflow configuration.
[core]
sql_alchemy_conn = [1]The correct URI format for PostgreSQL with psycopg2 driver is postgresql+psycopg2://user:pass@localhost/airflow. This is commonly used for production Airflow setups.
Complete the command to initialize the Airflow metadata database.
airflow db [1]The command airflow db init initializes the metadata database, creating the necessary tables and applying initial migrations.
Fix the error in the SQLAlchemy connection string by choosing the correct driver name.
sql_alchemy_conn = postgresql+[1]://user:pass@localhost/airflow
The correct driver for PostgreSQL in SQLAlchemy connection strings is psycopg2. Other options are for different databases.
Fill both blanks to create a dictionary comprehension that filters tasks with retries greater than 3.
filtered_tasks = {task_id: task for task_id, task in tasks.items() if task.[1] [2] 3}The attribute retries holds the retry count. We filter tasks where retries are greater than 3 using the '>' operator.
Fill all three blanks to create a dictionary comprehension that maps task IDs to their owner names for tasks with priority above 5.
owners = { [1]: [2].owner for [3], [2] in dag.tasks.items() if [2].priority_weight > 5 }The dictionary comprehension uses task_id as key, task as value variable, and task_key as the loop variable for keys in dag.tasks.items().