ashb commented on a change in pull request #6340: [Airflow-5660] Try to find
the task in DB before regressing to search…
URL: https://github.com/apache/airflow/pull/6340#discussion_r335210463
##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -545,6 +545,27 @@ def _labels_to_key(self, labels):
return None
with create_session() as session:
+ task = (
+ session
+ .query(TaskInstance)
+ .filter_by(task_id=task_id, dag_id=dag_id,
execution_date=ex_time)
+ .first()
Review comment:
```suggestion
.one_or_none()
```
----------------------------------------------------------------
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