200+ Top Excuses for Blocking Someone You Can Use Anytime

Airflow Xcom Example ((link)) -

Title: Mastering Data Sharing in Airflow: XComs Explained with a Real Example

extract = PythonOperator( task_id='extract_order_task', python_callable=extract_order )

def auto_push(): return "auto_xcom" # automatically in XCom airflow xcom example

process = PythonOperator( task_id='process_order_task', python_callable=process_order )

Go to Task Instance → XCom tab → See key-value pairs. Title: Mastering Data Sharing in Airflow: XComs Explained

Use return as a shortcut – return value auto-pushes to return_value key.

# Push context['ti'].xcom_push(key='user_id', value=123) user = context['ti'].xcom_pull(task_ids='task_a', key='user_id') value=123) user = context['ti'].xcom_pull(task_ids='task_a'

def pull_func(ti): value = ti.xcom_pull(task_ids='push_task', key='result') print(value)

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *