You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/12/18 18:53:11 UTC
[airflow] branch master updated: Fix invalid provider name - Apache
Kylin (#13157)
This is an automated email from the ASF dual-hosted git repository.
kamilbregula pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new 101d561 Fix invalid provider name - Apache Kylin (#13157)
101d561 is described below
commit 101d561cec0f9aff45f1a1fbdf01275775fad369
Author: Kamil BreguĊa <mi...@users.noreply.github.com>
AuthorDate: Fri Dec 18 19:51:51 2020 +0100
Fix invalid provider name - Apache Kylin (#13157)
---
airflow/providers/apache/kylin/provider.yaml | 2 +-
scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/airflow/providers/apache/kylin/provider.yaml b/airflow/providers/apache/kylin/provider.yaml
index c1c1d77..d5b5778 100644
--- a/airflow/providers/apache/kylin/provider.yaml
+++ b/airflow/providers/apache/kylin/provider.yaml
@@ -17,7 +17,7 @@
---
package-name: apache-airflow-providers-apache-kylin
-name: Apache Hive
+name: Apache Kylin
description: |
`Apache Kylin <https://kylin.apache.org/>`__
diff --git a/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py b/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py
index 61bba9a..038e027 100755
--- a/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py
+++ b/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py
@@ -311,6 +311,13 @@ def check_doc_files(yaml_files: Dict[str, Dict]):
sys.exit(1)
+def check_unique_provider_name(yaml_files: Dict[str, Dict]):
+ provider_names = [d['name'] for d in yaml_files.values()]
+ duplicates = {x for x in provider_names if provider_names.count(x) > 1}
+ if duplicates:
+ errors.append(f"Provider name must be unique. Duplicates: {duplicates}")
+
+
if __name__ == '__main__':
all_provider_files = sorted(glob(f"{ROOT_DIR}/airflow/providers/**/provider.yaml", recursive=True))
if len(sys.argv) > 1:
@@ -329,6 +336,7 @@ if __name__ == '__main__':
check_completeness_of_list_of_transfers(all_parsed_yaml_files)
check_duplicates_in_list_of_transfers(all_parsed_yaml_files)
check_hook_classes(all_parsed_yaml_files)
+ check_unique_provider_name(all_parsed_yaml_files)
if all_files_loaded:
# Only check those if all provider files are loaded