kaxil commented on code in PR #60268:
URL: https://github.com/apache/airflow/pull/60268#discussion_r2677526245


##########
task-sdk/src/airflow/sdk/bases/decorator.py:
##########
@@ -149,6 +150,52 @@ def _find_id_suffixes(dag: DAG) -> Iterator[int]:
     return f"{core}__{max(_find_id_suffixes(dag)) + 1}"
 
 
+def unwrap_partial(fn):
+    while isinstance(fn, partial):
+        fn = fn.func
+    return fn
+
+
+def unwrap_callable(func):
+    from airflow.sdk.bases.decorator import _TaskDecorator
+    from airflow.sdk.definitions.mappedoperator import OperatorPartial
+
+    # Airflow-specific unwrap
+    if isinstance(func, (_TaskDecorator, OperatorPartial)):
+        func = getattr(func, "function", getattr(func, "_func", func))
+
+    # Unwrap functools.partial
+    func = unwrap_partial(func)
+
+    # Unwrap @functools.wraps chains

Review Comment:
   Worth removing this code comments -- AI sometime generates obvious / useless 
comments :) 



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