我怎样才能停止 [UtcDateTime cache_ok ] 警告?当我 运行 气流 dag

how can I stop the [UtcDateTime cache_ok ]warn? When I run airflow dag

当我 运行 气流服务器时: 我的版本是 airflow latest(2.2)。当我 运行 程序时,dag 日志

"SAWarning: TypeDecorator UtcDateTime(timezone=True) will not produce a cache key because the ``cache_ok`` attribute is not set to True.  This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions.  Set this attribute to True if this type object's state is safe to use in a cache key, or False to disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)
  return session.query(DagRun)"
====
the scheduler  log:
/airflow/jobs/scheduler_job.py:944 SAWarning: TypeDecorator UtcDateTime(timezone=True) will not produce a cache key because the ``cache_ok`` attribute is not set to True.
===

我已将“cache_ok = true”添加到 airflow.cfg,或“scheduler_job.py”Class,但我不喜欢它

这是由于 SQLAlchemy 1.4 中的更改(参见 release notes

如果您收到此警告,则表示您没有从约束(请参阅 docs)安装 Airflow,因为 Airflow 2.2.3 的约束具有 SQLAlchemy==1.3.24

至于未来的版本,Airflow 2.2.4 将 lib 版本限制为 <1.4PR