This is an automated email from the ASF dual-hosted git repository.
kaxilnaik 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 bd22d28eb91 Migrate `influxdb` provider to `common.compat` (#57092)
bd22d28eb91 is described below
commit bd22d28eb9168de5a5ad7c0b92b022ceea39281d
Author: ChenChen Lai <[email protected]>
AuthorDate: Thu Oct 23 23:36:56 2025 +0800
Migrate `influxdb` provider to `common.compat` (#57092)
This PR is a part of #57018 about provider influxdb.
---
providers/influxdb/pyproject.toml | 2 ++
.../src/airflow/providers/influxdb/hooks/influxdb.py | 2 +-
.../src/airflow/providers/influxdb/operators/influxdb.py | 2 +-
.../src/airflow/providers/influxdb/version_compat.py | 15 ++++-----------
4 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/providers/influxdb/pyproject.toml
b/providers/influxdb/pyproject.toml
index 8807a72eb75..7ecaf1bb6cc 100644
--- a/providers/influxdb/pyproject.toml
+++ b/providers/influxdb/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",
"influxdb-client>=1.19.0",
"requests>=2.32.0,<3",
]
@@ -67,6 +68,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/influxdb/src/airflow/providers/influxdb/hooks/influxdb.py
b/providers/influxdb/src/airflow/providers/influxdb/hooks/influxdb.py
index 2bb195145f9..7aa79fb6944 100644
--- a/providers/influxdb/src/airflow/providers/influxdb/hooks/influxdb.py
+++ b/providers/influxdb/src/airflow/providers/influxdb/hooks/influxdb.py
@@ -31,7 +31,7 @@ from influxdb_client import InfluxDBClient
from influxdb_client.client.write.point import Point
from influxdb_client.client.write_api import SYNCHRONOUS
-from airflow.providers.influxdb.version_compat import BaseHook
+from airflow.providers.common.compat.sdk import BaseHook
if TYPE_CHECKING:
import pandas as pd
diff --git
a/providers/influxdb/src/airflow/providers/influxdb/operators/influxdb.py
b/providers/influxdb/src/airflow/providers/influxdb/operators/influxdb.py
index 62e9b75bcc9..9ca440e7c16 100644
--- a/providers/influxdb/src/airflow/providers/influxdb/operators/influxdb.py
+++ b/providers/influxdb/src/airflow/providers/influxdb/operators/influxdb.py
@@ -20,8 +20,8 @@ from __future__ import annotations
from collections.abc import Sequence
from typing import TYPE_CHECKING
+from airflow.providers.common.compat.sdk import BaseOperator
from airflow.providers.influxdb.hooks.influxdb import InfluxDBHook
-from airflow.providers.influxdb.version_compat import BaseOperator
if TYPE_CHECKING:
try:
diff --git
a/providers/influxdb/src/airflow/providers/influxdb/version_compat.py
b/providers/influxdb/src/airflow/providers/influxdb/version_compat.py
index df436e529f0..fe3ccfcfd3d 100644
--- a/providers/influxdb/src/airflow/providers/influxdb/version_compat.py
+++ b/providers/influxdb/src/airflow/providers/influxdb/version_compat.py
@@ -30,14 +30,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]
-
-if AIRFLOW_V_3_0_PLUS:
- from airflow.sdk import BaseOperator
-else:
- from airflow.models import BaseOperator
-
-__all__ = ["AIRFLOW_V_3_0_PLUS", "AIRFLOW_V_3_1_PLUS", "BaseHook",
"BaseOperator"]
+__all__ = [
+ "AIRFLOW_V_3_0_PLUS",
+ "AIRFLOW_V_3_1_PLUS",
+]