uranusjr commented on code in PR #70190:
URL: https://github.com/apache/airflow/pull/70190#discussion_r3689936287


##########
dev/registry/registry_tools/types.py:
##########
@@ -147,11 +189,39 @@
 
 # Class-level sections used by extract_parameters.py (subset of flat that
 # list full class paths rather than simple entries).
+#
+# "plugins" and "dialects" are also flat/class-path sections, but each entry 
is a
+# dict (plugin-class / dialect-class-name) rather than a bare string, and the
+# integration-name field they carry differs between the two, so 
extract_parameters.py
+# still walks them with their own loops instead of this generic one. The 
class-path
+# field name itself is shared via DICT_SHAPED_CLASS_LEVEL_SECTIONS below so 
both
+# extract_versions.py and extract_parameters.py read it from one place.
 CLASS_LEVEL_SECTIONS: dict[str, str] = {
     "notifications": "notifier",
     "secrets-backends": "secret",
     "logging": "logging",
     "executors": "executor",
+    "extra-links": "extra_link",
+    "queues": "queue",
+    "auth-managers": "auth_manager",
+    "db-managers": "db_manager",
+}
+
+# Maps yaml section key -> (type id, class-path field name) for dict-shaped
+# class-level sections (each yaml entry is a dict, not a bare class-path
+# string), shared by extract_versions.py and extract_parameters.py so the
+# field name is defined exactly once.
+DICT_SHAPED_CLASS_LEVEL_SECTIONS: dict[str, tuple[str, str]] = {
+    "plugins": ("plugin", "plugin-class"),
+    "dialects": ("dialect", "dialect-class-name"),
+}

Review Comment:
   I think this can have a third component `name` and `dialect-type` instead, 
so `discover_classes_from_provider` only needs one loop instead of two.



-- 
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]

Reply via email to