xBis7 commented on code in PR #61289:
URL: https://github.com/apache/airflow/pull/61289#discussion_r2753745294


##########
shared/configuration/src/airflow_shared/configuration/parser.py:
##########
@@ -109,6 +109,35 @@ def _is_template(configuration_description: dict[str, 
dict[str, Any]], section:
     return configuration_description.get(section, {}).get(key, 
{}).get("is_template", False)
 
 
+def configure_parser_from_configuration_description(
+    parser: ConfigParser,
+    configuration_description: dict[str, dict[str, Any]],
+    all_vars: dict[str, Any],
+) -> None:
+    """
+    Configure a ConfigParser based on configuration description.
+
+    :param parser: ConfigParser to configure
+    :param configuration_description: configuration description from config.yml
+    """
+    for section, section_desc in configuration_description.items():
+        parser.add_section(section)
+        options = section_desc["options"]
+        for key in options:
+            default_value = options[key]["default"]
+            is_template = options[key].get("is_template", False)
+            if (default_value is not None) and not (
+                options[key].get("version_deprecated") or 
options[key].get("deprecation_reason")

Review Comment:
   So, if the config has `version_deprecated` or `deprecation_reason` is 
ignored and the default value isn't set. Is that correct?
   
   Can you add a test case for
   
   
https://github.com/apache/airflow/blob/337aee896a9102c1d5c002b9708d1a49da9e98ca/shared/configuration/src/airflow_shared/configuration/parser.py#L1008
   
   
https://github.com/apache/airflow/blob/337aee896a9102c1d5c002b9708d1a49da9e98ca/shared/configuration/src/airflow_shared/configuration/parser.py#L176
   
   ?
   
   If the config is ignored, then it should return a VALUE_NOT_FOUND_SENTINEL.



##########
shared/configuration/src/airflow_shared/configuration/parser.py:
##########
@@ -109,6 +109,35 @@ def _is_template(configuration_description: dict[str, 
dict[str, Any]], section:
     return configuration_description.get(section, {}).get(key, 
{}).get("is_template", False)
 
 
+def configure_parser_from_configuration_description(

Review Comment:
   Nice moving it under shared.



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