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


##########
airflow/jobs/job.py:
##########
@@ -104,12 +105,13 @@ class Job(Base, LoggingMixin):
     Only makes sense for SchedulerJob and BackfillJob instances.
     """
 
-    def __init__(self, executor=None, heartrate=None, **kwargs):
+    def __init__(self, executor: BaseExecutor | None = None, heartrate=None, 
**kwargs):
         # Save init parameters as DB fields
         self.heartbeat_failed = False
         self.hostname = get_hostname()
         if executor:
             self.executor = executor
+            self.executors = [executor]

Review Comment:
   I also don't think eventually job should keep some extra fields that are not 
part of the data model. It's a hack really as Job is an ORM model. Both 
executor (executors) and heartrate kept in in job should be kept somewhere else 
if you ask me. Part of it was addressed when I split Job to have a separte Job 
Runner - and then likely we should eventually move both - heartbeat and 
executor(s) to the runners (but likely in a separate PR)



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