使用 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) # 依赖 + 数据
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 构建数据流水线