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


##########
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:
   +1, I'm unsure what is the context here, seems @romsharon98 has tried it 
before[[link](https://github.com/apache/airflow/pull/38892#discussion_r1566141583)],
 do we expect the actual name of a callable instead of `repr` one



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