使用 Airflow 建置資料管線
Volker Janz
Senior Developer Advocate at Astronomer

xcom_push() 與 xcom_pull()
@task 的回傳值會變成一個 XComArg
@task def get_config(): return {"name": "daily_etl"} @task def run_pipeline(config): print(config["name"])config = get_config() # XComArgrun_pipeline(config) # dependency + data
get_timestamp = BashOperator( task_id="get_timestamp", bash_command="date +%Y-%m-%d") @task def log_timestamp(ts_value): print(f"Timestamp: {ts_value}")log_timestamp(get_timestamp.output)


AIRFLOW__COMMON_IO__XCOM_OBJECTSTORAGE_THRESHOLD:僅在達到臨界值時,才把 XCom 存到物件儲存使用 Airflow 建置資料管線