def load_data(**kwargs): ti = kwargs['ti'] # Pulls the return value from 'extract_data' task file_path = ti.xcom_pull(task_ids='extract_data') # Pulls a specific key from a specific task count = ti.xcom_pull(task_ids='process_data', key='record_count') print(f"Loading data from {file_path} with {count} records") Airflow 2.0 introduced the ability to swap the XCom backend. This changes the game regarding the "Size Limit" constraint mentioned above. Ps1 Pbp Roms Archive — Vii, Metal Gear
extract_task = PythonOperator( task_id='extract_data', python_callable=extract_data, ) You can explicitly push data using the xcom_push method inside the function. This is useful if you need to push multiple values. Las Mujeres Que Aman Demasiado Pdf | Patricia Faur Gratis
XCom (short for Cross-Communication ) is one of the most powerful yet misunderstood features in Apache Airflow. It allows tasks to exchange data, transforming Airflow from a simple scheduler into a dynamic data-driven workflow engine.
If a task returns a value, Airflow automatically pushes it to XCom with the key return_value . This is the cleanest method.
def process_data(**kwargs): ti = kwargs['ti'] ti.xcom_push(key='processed_file', value='/tmp/processed.csv') ti.xcom_push(key='record_count', value=500) Downstream tasks pull data using xcom_pull .
def extract_data(**kwargs): # logic here file_path = "/tmp/data_2023.csv" return file_path # This is automatically pushed to XCom