跳转到主要内容

检查Airflow版本之间的兼容性

项目描述

Apache Airflow升级检查

PyPI version License PyPI - Python Version PyPI - Downloads Twitter Follow Slack Status

此包旨在简化从Apache Airflow 1.10到2.0的升级过程。

虽然我们已经投入了大量努力,使升级尽可能无痛,其中许多更改提供了升级路径(旧代码继续工作并打印出弃用警告),但不幸的是,有些破坏性更改我们无法提供兼容性适配器。

推荐的升级路径是首先升级到1.10系列的最新版本(撰写时为1.10.15),然后运行此脚本。

pip install apache-airflow-upgrade-check
airflow upgrade_check

这将打印出在升级到2.0.0或更高版本之前应遵循的多个操作项。

如果未报告问题,则命令的退出代码将为 0(成功),否则为 1。

例如:

============================================= STATUS =============================================

Check for latest versions of apache-airflow and checker.................................SUCCESS
Legacy UI is deprecated by default......................................................SUCCESS
Users must set a kubernetes.pod_template_file value.....................................FAIL
Changes in import paths of hooks, operators, sensors and others.........................FAIL
Remove airflow.AirflowMacroPlugin class.................................................SUCCESS
Check versions of PostgreSQL, MySQL, and SQLite to ease upgrade to Airflow 2.0..........SUCCESS
Fernet is enabled by default............................................................FAIL
Logging configuration has been moved to new section.....................................SUCCESS
Connection.conn_id is not unique........................................................SUCCESS
GCP service account key deprecation.....................................................SUCCESS
Users must delete deprecated configs for KubernetesExecutor.............................FAIL
Changes in import path of remote task handlers..........................................SUCCESS
Chain between DAG and operator not allowed..............................................SUCCESS
SendGrid email uses old airflow.contrib module..........................................SUCCESS
Connection.conn_type is not nullable....................................................SUCCESS
Found 16 problems.

======================================== RECOMMENDATIONS =========================================

Users must set a kubernetes.pod_template_file value
---------------------------------------------------
In Airflow 2.0, KubernetesExecutor Users need to set a pod_template_file as a base
value for all pods launched by the KubernetesExecutor


Problems:

  1.  Please create a pod_template_file by running `airflow generate_pod_template`.
This will generate a pod using your aiflow.cfg settings

...

此外,您还可以使用“升级配置”来

  • 指定您想忽略的规则
  • 使用自定义规则扩展检查

例如:

airflow upgrade_check --config=/files/upgrade.yaml

配置文件应该是一个类似于这个的合适的 yaml 文件

ignored_rules:
  - LegacyUIDeprecated
  - ConnTypeIsNotNullableRule
  - PodTemplateFileRule

custom_rules:
  - path.to.upgrade_module.VeryCustomCheckClass
  - path.to.upgrade_module.VeryCustomCheckClass2

变更日志

1.4.0

  • 添加 conf,不能从 airflow 规则导入 (#14400)
  • 将规则升级到建议重命名 [scheduler] max_threads[scheduler] parsing_processes (#14913)
  • 修复在 PTY 中运行 "upgrade_check" 命令的问题。 (#14977)
  • 如果检测到无效版本,则跳过 DatabaseVersionCheckRule 检查 (#15122)
  • 修复 LegacyUIDeprecated 中对 False 的过度特定解析 (#14967)
  • 修复继承 DbApiHook 的类的假阳性 (#16543)

1.3.0

  • 修复关于未在 dag 文件中使用过的类的错误警告 (#14700)
  • 对于升级规则,从 dag_folder 设置填充 DagBag (#14588)
  • 错误修正:通过插件检查自定义执行器的假阳性 (#14680)
  • 错误修正:修复导入更改规则中的假警报 (#14493)
  • 使用 CustomSQLAInterface 而不是 SQLAInterface (#14475)
  • 修复比较 airflow 版本以与旧版本打包库一起工作的问题 (#14435)
  • 修复升级检查中的错误警告和在读取文件中的错误 (#14344)
  • 处理 MySQL 版本的可能的后缀 + 避免硬编码 (#14274)

1.2.0

  • 将升级检查选项添加到检查列表 (#13392)
  • 在宏插件升级中添加更清晰的读取失败异常 (#13371)
  • HostnameCallable 规则中的默认值视为良好的值 (#13670)
  • 创建 CustomExecutorsRequireFullPathRule 类 (#13678)
  • 删除 UndefinedJinjaVariableRule
  • SparkJDBCOperator 类创建规则 conn_id (#13798)
  • 创建 DatabaseVersionCheckRule 类 (#13955)
  • 为升级检查添加版本命令 (#12929)
  • 使用表格格式列出升级检查规则 (#14139)
  • 修复损坏的 airflow upgrade_check 命令 (#14137)

项目详情


下载文件

下载您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分布

apache-airflow-upgrade-check-1.4.0.tar.gz (40.9 kB 查看散列)

上传时间

构建分布

apache_airflow_upgrade_check-1.4.0-py2.py3-none-any.whl (58.1 kB 查看散列)

上传时间 Python 2 Python 3

支持