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


##########
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:
   yes callback itself provides the good enough information.
   Perhaps we are much like to the "position" instead of actual name.
   
   Take the following example
   
   if we have on_success_callback = [
     slack1,
     slack2,
     slack3
   ]
   
   with only "name" we can't distinguish which "slack" failed.



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