0
0
Apache Airflowdevops~10 mins

Task documentation and tags in Apache Airflow - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a description to an Airflow task.

Apache Airflow
task = PythonOperator(task_id='print_date', python_callable=print_date, dag=dag, [1]='Prints the current date')
Drag options to blanks, or click blank then click option'
Atags
Bdescription
Cdoc_md
Downer
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'description' instead of 'doc_md'
Confusing 'tags' with documentation
2fill in blank
medium

Complete the code to add tags to an Airflow task.

Apache Airflow
task = BashOperator(task_id='run_script', bash_command='echo Hello', dag=dag, [1]=['example', 'test'])
Drag options to blanks, or click blank then click option'
Atags
Bdoc_md
Cowner
Ddescription
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'doc_md' instead of 'tags'
Trying to assign tags with 'description'
3fill in blank
hard

Fix the error in the task definition to correctly add documentation.

Apache Airflow
task = PythonOperator(task_id='task1', python_callable=my_func, dag=dag, doc_md=[1])
Drag options to blanks, or click blank then click option'
AThis is a task documentation
B'This is a task documentation'
C['This is a task documentation']
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the string
Passing a list instead of a string
4fill in blank
hard

Fill both blanks to add tags and documentation to an Airflow task.

Apache Airflow
task = BashOperator(task_id='task2', bash_command='ls', dag=dag, [1]=['data', 'etl'], [2]='Lists files in directory')
Drag options to blanks, or click blank then click option'
Atags
Bdoc_md
Cowner
Ddescription
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping tags and doc_md
Using description instead of doc_md
5fill in blank
hard

Fill all three blanks to add tags, documentation, and owner to an Airflow task.

Apache Airflow
task = PythonOperator(task_id='task3', python_callable=my_func, dag=dag, [1]=['analytics'], [2]='Runs analytics job', [3]='data_team')
Drag options to blanks, or click blank then click option'
Atags
Bdoc_md
Cowner
Ddescription
Attempts:
3 left
💡 Hint
Common Mistakes
Using description instead of doc_md
Mixing up owner and tags