jason810496 commented on code in PR #61289:
URL: https://github.com/apache/airflow/pull/61289#discussion_r2754358836
##########
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?
Yes, that is correct.
> Can you add a test case for
Sure! I just added it.
--
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]