You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by el...@apache.org on 2025/10/22 05:24:08 UTC

(airflow) branch main updated: Migrate apprise provider to ``common.compat`` (#57005)

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 a8a0d62186a Migrate apprise provider to ``common.compat`` (#57005)
a8a0d62186a is described below

commit a8a0d62186acb6bb66bbd1eeda5263a8be802b78
Author: Kaxil Naik <ka...@apache.org>
AuthorDate: Wed Oct 22 06:24:02 2025 +0100

    Migrate apprise provider to ``common.compat`` (#57005)
    
    Replace version-specific conditional imports with ``common.compat`` layer.
    This standardizes compatibility handling across Airflow 2.x and 3.x.
---
 providers/apprise/pyproject.toml                                  | 2 +-
 providers/apprise/src/airflow/providers/apprise/hooks/apprise.py  | 2 +-
 providers/apprise/src/airflow/providers/apprise/version_compat.py | 7 +------
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/providers/apprise/pyproject.toml b/providers/apprise/pyproject.toml
index 00583b22eaa..95a4347257b 100644
--- a/providers/apprise/pyproject.toml
+++ b/providers/apprise/pyproject.toml
@@ -58,7 +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.6.1",
+    "apache-airflow-providers-common-compat>=1.7.4",    # + TODO: bump to next version
     "apprise>=1.8.0",
 ]
 
diff --git a/providers/apprise/src/airflow/providers/apprise/hooks/apprise.py b/providers/apprise/src/airflow/providers/apprise/hooks/apprise.py
index 57265590518..84047c8ec05 100644
--- a/providers/apprise/src/airflow/providers/apprise/hooks/apprise.py
+++ b/providers/apprise/src/airflow/providers/apprise/hooks/apprise.py
@@ -24,7 +24,7 @@ from typing import TYPE_CHECKING, Any
 import apprise
 from apprise import AppriseConfig, NotifyFormat, NotifyType
 
-from airflow.providers.apprise.version_compat import BaseHook
+from airflow.providers.common.compat.sdk import BaseHook
 
 if TYPE_CHECKING:
     from apprise import AppriseAttachment
diff --git a/providers/apprise/src/airflow/providers/apprise/version_compat.py b/providers/apprise/src/airflow/providers/apprise/version_compat.py
index fbb542e4490..f5bb3ae555c 100644
--- a/providers/apprise/src/airflow/providers/apprise/version_compat.py
+++ b/providers/apprise/src/airflow/providers/apprise/version_compat.py
@@ -35,9 +35,4 @@ 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"]
+__all__ = ["AIRFLOW_V_3_0_PLUS", "AIRFLOW_V_3_1_PLUS"]