potiuk commented on code in PR #30255:
URL: https://github.com/apache/airflow/pull/30255#discussion_r1161335827


##########
airflow/jobs/base_job.py:
##########
@@ -276,5 +251,44 @@ def run(self) -> int | None:
         Stats.incr(self.__class__.__name__.lower() + "_end", 1, 1)
         return ret
 
-    def _execute(self) -> int | None:
-        raise NotImplementedError("This method needs to be overridden")
+    @property
+    def job_runner(self) -> BaseJobRunner:
+        """Returns the job runner instance."""
+        return self._job_runner
+
+    @provide_session
+    def most_recent_job(self, session=NEW_SESSION) -> BaseJob | None:
+        """Returns the most recent job of this type, if any, based on last 
heartbeat received."""
+        return most_recent_job(self.job_type, session=session)
+
+
+@provide_session
+def perform_heartbeat(job: BaseJob | BaseJobPydantic, only_if_necessary: bool, 
session=None):

Review Comment:
   Very much so.



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