This is an automated email from the ASF dual-hosted git repository.

kaxil 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 f3532c60eda Use Task SDK TaskInstanceState in OpenSearch log handler 
(#72444)
f3532c60eda is described below

commit f3532c60eda46be86e6f9b747ae0001a9b600149
Author: atamagrawal <[email protected]>
AuthorDate: Thu Oct 1 14:52:37 2026 -0700

    Use Task SDK TaskInstanceState in OpenSearch log handler (#72444)
    
    * Use Task SDK TaskInstanceState in OpenSearch log handler
    
    Replaces the airflow.utils.state import with airflow.sdk to reduce the
    airflow-core dependency in the OpenSearch provider.
    
    closes: #72409
    
    * Import TaskInstanceState via common compat SDK in OpenSearch handler
    
    Airflow 3.0.6 does not export TaskInstanceState from airflow.sdk, so the
    direct import breaks provider compatibility tests. Use the compat SDK shim
    which falls back to airflow.utils.state on older 3.0.x releases.
    
    ---------
    
    Co-authored-by: Atam Prakash Agrawal <[email protected]>
---
 .../opensearch/src/airflow/providers/opensearch/log/os_task_handler.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/providers/opensearch/src/airflow/providers/opensearch/log/os_task_handler.py 
b/providers/opensearch/src/airflow/providers/opensearch/log/os_task_handler.py
index adda50dd0fd..bdc34643b40 100644
--- 
a/providers/opensearch/src/airflow/providers/opensearch/log/os_task_handler.py
+++ 
b/providers/opensearch/src/airflow/providers/opensearch/log/os_task_handler.py
@@ -43,14 +43,13 @@ import airflow.logging_config as alc
 from airflow.exceptions import AirflowProviderDeprecationWarning
 from airflow.models import DagRun
 from airflow.providers.common.compat.module_loading import import_string
-from airflow.providers.common.compat.sdk import AirflowException, conf
+from airflow.providers.common.compat.sdk import AirflowException, 
TaskInstanceState, conf
 from airflow.providers.opensearch.log.os_json_formatter import 
OpensearchJSONFormatter
 from airflow.providers.opensearch.log.os_response import Hit, 
OpensearchResponse
 from airflow.providers.opensearch.version_compat import AIRFLOW_V_3_0_PLUS, 
AIRFLOW_V_3_2_PLUS
 from airflow.utils.log.file_task_handler import FileTaskHandler
 from airflow.utils.log.logging_mixin import ExternalLoggingMixin, LoggingMixin
 from airflow.utils.session import create_session
-from airflow.utils.state import TaskInstanceState
 
 if TYPE_CHECKING:
     from airflow.models.taskinstance import TaskInstance, TaskInstanceKey

Reply via email to