In Apache Airflow, what is the primary mechanism used to share small pieces of data between tasks?
Think about the built-in Airflow feature designed for inter-task communication.
XCom (short for cross-communication) is Airflow's built-in feature to share small amounts of data between tasks by pushing and pulling key-value pairs.
What is the output of the following Airflow PythonOperator task code snippet when no XCom value exists for the given key?
ti.xcom_pull(key='nonexistent_key', task_ids='task_a')
Consider what Airflow returns when no XCom value is found for a key.
If no XCom value exists for the specified key and task, Airflow returns None instead of raising an error.
Which code snippet correctly pushes a value to XCom inside a PythonOperator's callable function?
Remember the method name and parameters for pushing XCom data.
The correct method is ti.xcom_push with named parameters key and value.
Which approach is best for sharing large datasets between Airflow tasks?
Think about XCom size limits and performance.
XCom is designed for small data. Large data should be stored externally and referenced by XCom to avoid performance issues.
You have two tasks: task_a pushes a value to XCom with key 'data', and task_b tries to pull it. But task_b always gets None. What is the most likely cause?
Consider task execution order and dependencies.
If task_b runs before task_a finishes, the XCom value won't exist yet, so xcom_pull returns None.