diff --git a/airflow/providers/elasticsearch/log/es_task_handler.py b/airflow/providers/elasticsearch/log/es_task_handler.py index 227148e52b921..1320756a2c17e 100644 --- a/airflow/providers/elasticsearch/log/es_task_handler.py +++ b/airflow/providers/elasticsearch/log/es_task_handler.py @@ -462,8 +462,7 @@ def close(self) -> None: if self.closed: return - # todo: remove `getattr` when min airflow version >= 2.6 - if not self.mark_end_on_close or getattr(self, "ctx_task_deferred", None): + if not self.mark_end_on_close: # when we're closing due to task deferral, don't mark end of log self.closed = True return