Skip to content

Commit

Permalink
Fix invalid provider name - Apache Kylin (#13157)
Browse files Browse the repository at this point in the history
  • Loading branch information
mik-laj committed Dec 18, 2020
1 parent 1be20c6 commit 101d561
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/providers/apache/kylin/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

---
package-name: apache-airflow-providers-apache-kylin
name: Apache Hive
name: Apache Kylin
description: |
`Apache Kylin <https://kylin.apache.org/>`__
Expand Down
8 changes: 8 additions & 0 deletions scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -329,6 +336,7 @@ def check_doc_files(yaml_files: Dict[str, Dict]):
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
Expand Down

0 comments on commit 101d561

Please sign in to comment.