ashb commented on a change in pull request #7085: [AIRFLOW-6334] Use classes 
instead list of string in executors
URL: https://github.com/apache/airflow/pull/7085#discussion_r364655454
 
 

 ##########
 File path: airflow/executors/base_executor.py
 ##########
 @@ -94,22 +96,43 @@ def queue_task_instance(
         # cfg_path is needed to propagate the config values if using 
impersonation
         # (run_as_user), given that there are different code paths running 
tasks.
         # For a long term solution we need to address AIRFLOW-1986
-        command_list_to_run = task_instance.command_as_list(
-            local=True,
+        deferred_run = task_instance.get_local_task_job_deferred_run(
             mark_success=mark_success,
             ignore_all_deps=ignore_all_deps,
             ignore_depends_on_past=ignore_depends_on_past,
             ignore_task_deps=ignore_task_deps,
             ignore_ti_state=ignore_ti_state,
             pool=pool,
             pickle_id=pickle_id,
-            cfg_path=cfg_path)
-        self.queue_command(
+            cfg_path=cfg_path,
+        )
+        self._queue_deferred_run(
             SimpleTaskInstance(task_instance),
-            command_list_to_run,
+            deferred_run,
             priority=task_instance.task.priority_weight_total,
             queue=task_instance.task.queue)
 
+    def queue_simple_task_instance(self, simple_task_instance: 
SimpleTaskInstance, simple_dag: SimpleDag):
+        """Queues simple task instance."""
+        priority = simple_task_instance.priority_weight
+        queue = simple_task_instance.queue
+
+        queue_task_run = LocalTaskJobDeferredRun(
+            dag_id=simple_task_instance.dag_id,
+            task_id=simple_task_instance.task_id,
+            execution_date=simple_task_instance.execution_date,
+            pool=simple_task_instance.pool,
+            subdir=simple_dag.full_filepath,
+            pickle_id=simple_dag.pickle_id
+        )
+
+        self._queue_deferred_run(
+            simple_task_instance,
+            queue_task_run,
+            priority=priority,
+            queue=queue
+        )
+
 
 Review comment:
   Task = Operators in your DAG
   TaskInstance = an "instance" of that operator for a given execution date/dag 
run.
   
   Yes it's slightly odd naming, but it does make some sense.
   
   As for the point about having two classes: yes. @kaxil and I are working on 
removing the "Simple" versions as part of our dag serialization work so I think 
this is fine for now, and anyway removing that class should be its own 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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to