uranusjr commented on code in PR #31278:
URL: https://github.com/apache/airflow/pull/31278#discussion_r1195815526
##########
scripts/in_container/run_provider_yaml_files_check.py:
##########
@@ -306,6 +306,20 @@ def check_hook_classes(yaml_files: dict[str, dict]):
)
+def check_trigger_classes(yaml_files: dict[str, dict]):
+ print("Checking triggers classes belong to package, exist and are classes")
+ resource_type = "triggers"
+ for yaml_file_path, provider_data in yaml_files.items():
+ provider_package =
pathlib.Path(yaml_file_path).parent.as_posix().replace("/", ".")
+ trigger_classes = []
+ for trigger_class in provider_data.get(resource_type, {}):
+ trigger_classes.extend(trigger_class["class-names"])
+ if trigger_classes:
+ check_if_objects_exist_and_belong_to_package(
+ set(trigger_classes), provider_package, yaml_file_path,
resource_type, ObjectType.CLASS
+ )
Review Comment:
```suggestion
trigger_classes = {
name
for trigger_class in provider_data.get(resource_type, {})
for name in names in trigger_class["class-names"]
}
if trigger_classes:
check_if_objects_exist_and_belong_to_package(
trigger_classes, provider_package, yaml_file_path,
resource_type, ObjectType.CLASS
)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]