可能是因为代码中缺少正确的日志设置,在自定义DAG中添加以下代码以设置日志记录和显示:
import logging
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
def my_function():
# some code here
logging.info('Logging message')
with DAG('my_dag') as dag:
run_my_function = PythonOperator(
task_id='my_task',
python_callable=my_function
)
添加日志记录和显示后,可以在UI中查看日志以追踪任何错误或失败情况。