jason810496 commented on code in PR #46544:
URL: https://github.com/apache/airflow/pull/46544#discussion_r1966117693


##########
airflow/configuration.py:
##########
@@ -891,58 +891,60 @@ def get(  # type: ignore[override,misc]
         section: str,
         key: str,
         suppress_warnings: bool = False,
+        lookup_from_deprecated_options: bool = True,
         _extra_stacklevel: int = 0,
         **kwargs,
     ) -> str | None:
         section = section.lower()
         key = key.lower()
         warning_emitted = False
-        deprecated_section: str | None
-        deprecated_key: str | None
+        deprecated_section: str | None = None
+        deprecated_key: str | None = None
 
-        option_description = self.configuration_description.get(section, 
{}).get(key, {})
-        if option_description.get("deprecated"):
-            deprecation_reason = option_description.get("deprecation_reason", 
"")
-            warnings.warn(
-                f"The '{key}' option in section {section} is deprecated. 
{deprecation_reason}",
-                DeprecationWarning,
-                stacklevel=2 + _extra_stacklevel,
-            )
-        # For when we rename whole sections
-        if section in self.inversed_deprecated_sections:
-            deprecated_section, deprecated_key = (section, key)
-            section = self.inversed_deprecated_sections[section]
-            if not self._suppress_future_warnings:
+        if lookup_from_deprecated_options:
+            option_description = self.configuration_description.get(section, 
{}).get(key, {})

Review Comment:
   Sure, I will create a PR to fix it  I the weekend ( currently out of laptop )



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