potiuk commented on code in PR #32604:
URL: https://github.com/apache/airflow/pull/32604#discussion_r1269502530


##########
airflow/configuration.py:
##########
@@ -151,15 +151,32 @@ def _default_config_file_path(file_name: str) -> str:
     return os.path.join(templates_dir, file_name)
 
 
-def retrieve_configuration_description() -> dict[str, dict[str, Any]]:
+def retrieve_configuration_description(
+    include_airflow: bool = True,
+    include_providers: bool = True,
+    selected_provider: str | None = None,
+    config_file_name: str = "config.yml",
+) -> dict[str, dict[str, Any]]:
     """
     Read Airflow configuration description from YAML file.
 
+    :param include_airflow: Include Airflow configs
+    :param include_providers: Include provider configs
+    :param selected_provider: If specified, include selected provider only
+    :param config_file_name: name of the file in "config_templates" directory 
to read default config from
     :return: Python dictionary containing configs & their info
     """
     base_configuration_description: dict[str, dict[str, Any]] = {}
-    with open(_default_config_file_path("config.yml")) as config_file:
-        base_configuration_description.update(yaml.safe_load(config_file))
+    if include_airflow:
+        with open(_default_config_file_path("config.yml")) as config_file:
+            base_configuration_description.update(yaml.safe_load(config_file))
+    if include_providers:
+        from airflow.providers_manager import ProvidersManager
+
+        for provider, config in ProvidersManager().provider_configs:
+            if selected_provider and provider != selected_provider:
+                continue
+            base_configuration_description.update(config)

Review Comment:
   Absolutely valid. When you want "all configuration" you should include both.



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