Python 中的 Apache Airflow 入门
Mike Metzger
Data Engineer
从命令行运行特定任务:
airflow tasks test <dag_id> <task_id> <date>
运行整个 Dag:
airflow dags trigger --logical-date <date> <dag_id>
@task - 将某个 Python 函数指定为 Airflow 任务@task.bash - 将 bash 命令输出作为 Airflow 任务结果返回@task.branch - 分支算子,用于在 Dag 中提供运行时选择FileSensor - 需要 filepath 参数,可能还需 mode 或 poke_interval 属性from airflow.sdk import dag, task)help(<Airflow object>),如 help(task)



Python 中的 Apache Airflow 入门