This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v1-10-stable
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v1-10-stable by this push:
new 7410dc9 Use Tabular Format for the List of Upgrade Check Rules
(#14139)
7410dc9 is described below
commit 7410dc908a1935e533859a4ae469377de1a7dc05
Author: Kaxil Naik <[email protected]>
AuthorDate: Mon Feb 8 22:00:13 2021 +0000
Use Tabular Format for the List of Upgrade Check Rules (#14139)
closes https://github.com/apache/airflow/issues/13858
**Before**:
```
❯ airflow upgrade_check --list
Upgrade Checks:
- VersionCheckRule: Check for latest versions of apache-airflow and checker
- AirflowMacroPluginRemovedRule: Remove airflow.AirflowMacroPlugin class
- BaseOperatorMetaclassRule: Ensure users are not using custom metaclasses
in custom operators
- ChainBetweenDAGAndOperatorNotAllowedRule: Chain between DAG and operator
not allowed.
- ConnTypeIsNotNullableRule: Connection.conn_type is not nullable
- CustomExecutorsRequireFullPathRule: Custom Executors now require full path
- DatabaseVersionCheckRule: Check versions of PostgreSQL, MySQL, and SQLite
to ease upgrade to Airflow 2.0
- DbApiRule: Hooks that run DB functions must inherit from DBApiHook
- FernetEnabledRule: Fernet is enabled by default
- GCPServiceAccountKeyRule: GCP service account key deprecation
- HostnameCallable: Unify hostname_callable option in core section
- ImportChangesRule: Changes in import paths of hooks, operators, sensors
and others
- LegacyUIDeprecated: Legacy UI is deprecated by default
- LoggingConfigurationRule: Logging configuration has been moved to new
section
- MesosExecutorRemovedRule: Removal of Mesos Executor
- NoAdditionalArgsInOperatorsRule: No additional argument allowed in
BaseOperator.
- PodTemplateFileRule: Users must set a kubernetes.pod_template_file value
- SendGridEmailerMovedRule: SendGrid email uses old airflow.contrib module
- SparkJDBCOperatorConnIdRule: Check Spark JDBC Operator default connection
name
- TaskHandlersMovedRule: Changes in import path of remote task handlers
- UniqueConnIdRule: Connection.conn_id is not unique
```
**After**:
```
❯ airflow upgrade_check --list
Rule Name Description
----------------------------------------
------------------------------------------------------------------------------
VersionCheckRule Check for latest versions of
apache-airflow and checker
AirflowMacroPluginRemovedRule Remove airflow.AirflowMacroPlugin
class
BaseOperatorMetaclassRule Ensure users are not using custom
metaclasses in custom operators
ChainBetweenDAGAndOperatorNotAllowedRule Chain between DAG and operator
not allowed.
ConnTypeIsNotNullableRule Connection.conn_type is not
nullable
CustomExecutorsRequireFullPathRule Custom Executors now require full
path
DatabaseVersionCheckRule Check versions of PostgreSQL,
MySQL, and SQLite to ease upgrade to Airflow 2.0
DbApiRule Hooks that run DB functions must
inherit from DBApiHook
FernetEnabledRule Fernet is enabled by default
GCPServiceAccountKeyRule GCP service account key
deprecation
HostnameCallable Unify hostname_callable option in
core section
ImportChangesRule Changes in import paths of hooks,
operators, sensors and others
LegacyUIDeprecated Legacy UI is deprecated by default
LoggingConfigurationRule Logging configuration has been
moved to new section
MesosExecutorRemovedRule Removal of Mesos Executor
NoAdditionalArgsInOperatorsRule No additional argument allowed in
BaseOperator.
PodTemplateFileRule Users must set a
kubernetes.pod_template_file value
SendGridEmailerMovedRule SendGrid email uses old
airflow.contrib module
SparkJDBCOperatorConnIdRule Check Spark JDBC Operator default
connection name
TaskHandlersMovedRule Changes in import path of remote
task handlers
UniqueConnIdRule Connection.conn_id is not unique
```
---
airflow/upgrade/checker.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/airflow/upgrade/checker.py b/airflow/upgrade/checker.py
index 889b0f4..fead361 100644
--- a/airflow/upgrade/checker.py
+++ b/airflow/upgrade/checker.py
@@ -19,6 +19,7 @@ from __future__ import absolute_import
import argparse
import logging
import sys
+from tabulate import tabulate
from typing import List
from airflow.upgrade.formatters import BaseFormatter
@@ -43,10 +44,11 @@ def check_upgrade(formatter, rules):
def list_checks():
print()
- print("Upgrade Checks:")
- for rule in ALL_RULES:
- rule_name = rule.__class__.__name__
- print("- {}: {}".format(rule_name, rule.title))
+ rules = (
+ (rule.__class__.__name__, rule.title)
+ for rule in ALL_RULES
+ )
+ print(tabulate(rules, headers=["Rule Name", "Description"]))
print()