This is an automated email from the ASF dual-hosted git repository.
eladkal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 6fd0142229e Fix elasticsearch provider to use SDK imports for Airflow
3.2+ (#64931)
6fd0142229e is described below
commit 6fd0142229eab87f23f95e5268aa80db1df8f9f3
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Apr 9 06:40:11 2026 +0300
Fix elasticsearch provider to use SDK imports for Airflow 3.2+ (#64931)
Update es_task_handler.py to import timezone and import_string from
airflow.sdk when running on Airflow 3.2+, with backwards-compatible
fallback to airflow.utils for older versions. Keep FileTaskHandler
and LoggingMixin imports from airflow.utils.log as they remain there.
---
.../src/airflow/providers/elasticsearch/log/es_task_handler.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/providers/elasticsearch/src/airflow/providers/elasticsearch/log/es_task_handler.py
b/providers/elasticsearch/src/airflow/providers/elasticsearch/log/es_task_handler.py
index 754974a76ce..3296f000f51 100644
---
a/providers/elasticsearch/src/airflow/providers/elasticsearch/log/es_task_handler.py
+++
b/providers/elasticsearch/src/airflow/providers/elasticsearch/log/es_task_handler.py
@@ -46,13 +46,14 @@ from airflow.providers.common.compat.sdk import conf
from airflow.providers.elasticsearch.log.es_json_formatter import
ElasticsearchJSONFormatter
from airflow.providers.elasticsearch.log.es_response import
ElasticSearchResponse, Hit, resolve_nested
from airflow.providers.elasticsearch.version_compat import AIRFLOW_V_3_0_PLUS,
AIRFLOW_V_3_2_PLUS
-from airflow.utils import timezone
from airflow.utils.log.file_task_handler import FileTaskHandler
from airflow.utils.log.logging_mixin import ExternalLoggingMixin, LoggingMixin
if AIRFLOW_V_3_2_PLUS:
from airflow._shared.module_loading import import_string
+ from airflow.sdk import timezone
else:
+ from airflow.utils import timezone # type: ignore[attr-defined,no-redef]
from airflow.utils.module_loading import import_string # type:
ignore[no-redef]
if TYPE_CHECKING: