Airflow 2 - 调试为什么 dag 没有加载

Airflow 2 - debugging why dag is not loading

在 Airflow 2 上,我的 dag 没有显示在 UI 上,我收到 DAG 导入错误 (...)。 错误消息不足以让我调试(它是一个自定义运算符,有很多自定义逻辑 - 所以我不想深入了解错误本身的细节)。 在 Airflow 1.X 我可以使用 cli:

airflow list_dags

为了获得更详细的调试消息,airflow 2 上有什么类似的东西吗? 我正在寻找一个 cli command/UI 选项,它会为我提供比我在网络服务器主屏幕上看到的错误消息更详细的错误消息。

upgrading manual 中所述 airflow list_dags 已更改为 airflow dags list

完整语法为:

airflow dags list [-h] [-o table, json, yaml] [-S SUBDIR]

有关详细信息,请参阅 docs

Airlfow's documentation 中所述,要测试 DAG 加载,您只需 运行:

python your-dag-file.py

如果在 DAG 加载阶段出现任何问题,您将在此处获得堆栈跟踪。

later sections 还描述了如何测试自定义运算符。