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 2022/03/02 15:07:22 UTC

[GitHub] [airflow] dstandish commented on a change in pull request #21916: Add map_index label to mapped KubernetesPodOperator

dstandish commented on a change in pull request #21916:
URL: https://github.com/apache/airflow/pull/21916#discussion_r817784022



##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -282,13 +282,17 @@ def _get_ti_pod_labels(context: Optional[dict] = None, include_try_number: bool
         if not context:
             return {}
 
-        labels = {
-            'dag_id': context['dag'].dag_id,
-            'task_id': context['task'].task_id,
-            'execution_date': context['ts'],
-        }
+        ti = context['ti']
+
+        labels = {'dag_id': ti.dag_id, 'task_id': ti.task_id, 'execution_date': context['ts']}

Review comment:
       probably we should replace `execution_date` with `run_id` here, since that is now the "real" PK component right?.  the signifigance of these labels, AFAIK, is just for "reattaching" to a pod after scheduler death, so it's just meant to be attrs that uniquely identify the TI.  though it needn't necessarily be done in this PR of course.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org