You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/02/08 11:23:19 UTC

[GitHub] [airflow] ashb commented on a change in pull request #7324: [AIRFLOW-6704] Copy common TaskInstance attributes from Task

ashb commented on a change in pull request #7324: [AIRFLOW-6704] Copy common TaskInstance attributes from Task
URL: https://github.com/apache/airflow/pull/7324#discussion_r376704377
 
 

 ##########
 File path: airflow/models/taskinstance.py
 ##########
 @@ -61,6 +61,21 @@
 from airflow.utils.timeout import timeout
 
 
+def refresh_from_task(ti, task, pool_override=None):
+    """
+    Copy the necessary attributes of a TaskInstance using its task.
+    """
+    ti.queue = task.queue
+    ti.pool = pool_override or task.pool
+    ti.pool_slots = task.pool_slots
+    ti.priority_weight = task.priority_weight_total
+    ti.run_as_user = task.run_as_user
+    ti.max_tries = task.retries
+    ti.run_as_user = task.run_as_user
+    ti.executor_config = task.executor_config
 
 Review comment:
   Ping @dimberman - I remember there was a previous issue about this field

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services