Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions providers/jdbc/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.4", # + TODO: bump to next version
"apache-airflow-providers-common-sql>=1.20.0",
"jaydebeapi>=1.1.1",
]
Expand All @@ -67,6 +68,7 @@ dev = [
"apache-airflow",
"apache-airflow-task-sdk",
"apache-airflow-devel-common",
"apache-airflow-providers-common-compat",
"apache-airflow-providers-common-sql",
# Additional devel dependencies (do not remove this line and add extra development dependencies)
]
Expand Down
6 changes: 1 addition & 5 deletions providers/jdbc/src/airflow/providers/jdbc/hooks/jdbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@
from airflow.providers.common.sql.hooks.sql import DbApiHook

if TYPE_CHECKING:
if TYPE_CHECKING:
try:
from airflow.sdk import Connection
except ImportError:
from airflow.models.connection import Connection # type: ignore[assignment]
from airflow.providers.common.compat.sdk import Connection


@contextmanager
Expand Down
2 changes: 2 additions & 0 deletions providers/jenkins/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.4", # + TODO: bump to next version
"python-jenkins>=1.8.2",
]

Expand All @@ -66,6 +67,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)
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import jenkins

from airflow.providers.jenkins.version_compat import BaseHook
from airflow.providers.common.compat.sdk import BaseHook


class JenkinsHook(BaseHook):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
from requests import Request

from airflow.exceptions import AirflowException
from airflow.providers.common.compat.sdk import BaseOperator
from airflow.providers.jenkins.hooks.jenkins import JenkinsHook
from airflow.providers.jenkins.version_compat import BaseOperator

JenkinsRequest = Mapping[str, Any]
ParamType = str | dict | list | None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@
from __future__ import annotations

from collections.abc import Iterable
from typing import TYPE_CHECKING

from airflow.exceptions import AirflowException
from airflow.providers.common.compat.sdk import BaseSensorOperator, Context
from airflow.providers.jenkins.hooks.jenkins import JenkinsHook
from airflow.providers.jenkins.version_compat import BaseSensorOperator

if TYPE_CHECKING:
from airflow.providers.jenkins.version_compat import Context


class JenkinsBuildSensor(BaseSensorOperator):
Expand Down
17 changes: 0 additions & 17 deletions providers/jenkins/src/airflow/providers/jenkins/version_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +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]

if AIRFLOW_V_3_0_PLUS:
from airflow.sdk import BaseOperator, BaseSensorOperator
from airflow.sdk.definitions.context import Context
else:
from airflow.models import BaseOperator
from airflow.sensors.base import BaseSensorOperator # type: ignore[no-redef]
from airflow.utils.context import Context

__all__ = [
"AIRFLOW_V_3_0_PLUS",
"AIRFLOW_V_3_1_PLUS",
"BaseHook",
"BaseOperator",
"BaseSensorOperator",
"Context",
]