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

vincbeck 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 7b78a72e6b5 Migrate openfaas provider to common.compat (#57134)
7b78a72e6b5 is described below

commit 7b78a72e6b50c76fd2cca0644f3ece2edec5caf3
Author: rich7420 <[email protected]>
AuthorDate: Fri Oct 24 23:29:17 2025 +0800

    Migrate openfaas provider to common.compat (#57134)
---
 providers/openfaas/pyproject.toml                                   | 2 ++
 providers/openfaas/src/airflow/providers/openfaas/hooks/openfaas.py | 2 +-
 providers/openfaas/src/airflow/providers/openfaas/version_compat.py | 6 ------
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/providers/openfaas/pyproject.toml 
b/providers/openfaas/pyproject.toml
index a28facd5554..736ed93ad06 100644
--- a/providers/openfaas/pyproject.toml
+++ b/providers/openfaas/pyproject.toml
@@ -58,6 +58,7 @@ requires-python = ">=3.10"
 # After you modify the dependencies, and rebuild your Breeze CI image with 
``breeze ci-image build``
 dependencies = [
     "apache-airflow>=2.10.0",
+    "apache-airflow-providers-common-compat>=1.8.0",
 ]
 
 [dependency-groups]
@@ -65,6 +66,7 @@ dev = [
     "apache-airflow",
     "apache-airflow-task-sdk",
     "apache-airflow-devel-common",
+    "apache-airflow-providers-common-compat",
     # Additional devel dependencies (do not remove this line and add extra 
development dependencies)
 ]
 
diff --git 
a/providers/openfaas/src/airflow/providers/openfaas/hooks/openfaas.py 
b/providers/openfaas/src/airflow/providers/openfaas/hooks/openfaas.py
index 24e87b2ba83..ed40770c70a 100644
--- a/providers/openfaas/src/airflow/providers/openfaas/hooks/openfaas.py
+++ b/providers/openfaas/src/airflow/providers/openfaas/hooks/openfaas.py
@@ -22,7 +22,7 @@ from typing import Any
 import requests
 
 from airflow.exceptions import AirflowException
-from airflow.providers.openfaas.version_compat import BaseHook
+from airflow.providers.common.compat.sdk import BaseHook
 
 OK_STATUS_CODE = 202
 
diff --git 
a/providers/openfaas/src/airflow/providers/openfaas/version_compat.py 
b/providers/openfaas/src/airflow/providers/openfaas/version_compat.py
index 465da77d0d9..a4fae50317e 100644
--- a/providers/openfaas/src/airflow/providers/openfaas/version_compat.py
+++ b/providers/openfaas/src/airflow/providers/openfaas/version_compat.py
@@ -35,13 +35,7 @@ def get_base_airflow_version_tuple() -> tuple[int, int, int]:
 AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
 AIRFLOW_V_3_1_PLUS: bool = get_base_airflow_version_tuple() >= (3, 1, 0)
 
-if AIRFLOW_V_3_1_PLUS:
-    from airflow.sdk import BaseHook
-else:
-    from airflow.hooks.base import BaseHook  # type: 
ignore[attr-defined,no-redef]
-
 __all__ = [
     "AIRFLOW_V_3_0_PLUS",
     "AIRFLOW_V_3_1_PLUS",
-    "BaseHook",
 ]

Reply via email to