howardyoo commented on code in PR #37948:
URL: https://github.com/apache/airflow/pull/37948#discussion_r1524167075
##########
airflow/jobs/job.py:
##########
@@ -211,35 +211,29 @@ def heartbeat(
heartbeat_callback(session)
self.log.debug("[heartbeat]")
except OperationalError:
- Stats.incr(convert_camel_to_snake(self.__class__.__name__) +
"_heartbeat_failure", 1, 1)
+ class_name = self.__class__.__name__
+ Stats.incr(convert_camel_to_snake(class_name) +
"_heartbeat_failure", 1, 1)
if not self.heartbeat_failed:
- self.log.exception("%s heartbeat got an exception",
self.__class__.__name__)
+ msg = f"{class_name} heartbeat got an exception"
+ self.log.exception(msg)
self.heartbeat_failed = True
- s.add_event(
+ span.add_event(
name="error",
- attributes={"message": f"{self.__class__.__name__}
heartbeat got an exception"},
+ attributes={"message": msg},
Review Comment:
I'd prefer to have a shorter code as much as possible! So, will def. remove
those dangling commas
--
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]