uranusjr commented on code in PR #41591:
URL: https://github.com/apache/airflow/pull/41591#discussion_r1724585414


##########
airflow/models/taskinstance.py:
##########
@@ -1550,11 +1550,21 @@ def _run_finished_callback(
     if callbacks:
         callbacks = callbacks if isinstance(callbacks, list) else [callbacks]
         for callback in callbacks:
-            log.info("Executing %s callback", callback.__name__)
+            if hasattr(callback, "__name__"):
+                log.info("Executing %s callback", callback.__name__)
+            elif hasattr(callback, "__class__"):
+                log.info("Executing %s callback", callback.__class__.__name__)
+            else:
+                log.info("Executing %s callback", callback.__code__)

Review Comment:
   Yeah position in list + the function object itself sounds like the best 
approach to me.



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