wyndhblb commented on a change in pull request #4163: [AIRFLOW-3319] -
KubernetsExecutor: Need in try_number in labels if getting them later
URL: https://github.com/apache/incubator-airflow/pull/4163#discussion_r240486765
##########
File path: airflow/contrib/executors/kubernetes_executor.py
##########
@@ -458,10 +459,16 @@ def _datetime_to_label_safe_datestring(datetime_obj):
def _labels_to_key(self, labels):
try:
+ try_num = 1
+ try:
+ try_num = int(labels.get('try_number', '1'))
+ except ValueError:
+ self.log.warn("could not get try_number as an int: %s",
labels.get('try_number', '1'))
return (
labels['dag_id'], labels['task_id'],
self._label_safe_datestring_to_datetime(labels['execution_date']),
- labels['try_number'])
+ try_num
Review comment:
Yes, older pods in a live system will not have this try number set, and
needs to be defaulted to something reasonable.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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