Copilot commented on code in PR #53196:
URL: https://github.com/apache/airflow/pull/53196#discussion_r2201140901


##########
airflow-core/src/airflow/utils/deprecation_tools.py:
##########
@@ -42,15 +42,26 @@ def getattr_with_deprecation(
     :return:
     """
     target_class_full_name = imports.get(name)
+
+    # Handle wildcard pattern "*" - redirect all attributes to target module
+    # Skip Python special attributes (dunder attributes) as they shouldn't be 
redirected
+    if not target_class_full_name and "*" in imports and not 
(name.startswith("__") and name.endswith("__")):
+        target_class_full_name = f"{imports['*']}.{name}"
+
     if not target_class_full_name:
         raise AttributeError(f"The module `{module!r}` has no attribute 
`{name!r}`")
+
+    # Determine the warning class name (may be overridden)
     warning_class_name = target_class_full_name
     if override_deprecated_classes and name in override_deprecated_classes:
         warning_class_name = override_deprecated_classes[name]
+
     message = f"The `{module}.{name}` class is deprecated. Please use 
`{warning_class_name!r}`."

Review Comment:
   [nitpick] The deprecation warning refers to a `class` even when the 
attribute may not actually be a class (e.g., functions or variables). Consider 
using a more general term like "attribute" to improve clarity.
   ```suggestion
       message = f"The `{module}.{name}` attribute is deprecated. Please use 
`{warning_class_name!r}`."
   ```



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