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
1 change: 1 addition & 0 deletions providers/http/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.8.0",
# The 2.26.0 release of requests got rid of the chardet LGPL mandatory dependency, allowing us to
# release it as a requirement for airflow
"requests>=2.32.0,<3",
Expand Down
2 changes: 1 addition & 1 deletion providers/http/src/airflow/providers/http/hooks/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
from requests_toolbelt.adapters.socket_options import TCPKeepAliveAdapter

from airflow.exceptions import AirflowException
from airflow.providers.common.compat.sdk import BaseHook
from airflow.providers.http.exceptions import HttpErrorException, HttpMethodException
from airflow.providers.http.version_compat import BaseHook

if TYPE_CHECKING:
from aiohttp.client_reqrep import ClientResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

from airflow.configuration import conf
from airflow.exceptions import AirflowException
from airflow.providers.common.compat.sdk import BaseHook, BaseOperator
from airflow.providers.http.triggers.http import HttpTrigger, serialize_auth_type
from airflow.providers.http.version_compat import BaseHook, BaseOperator
from airflow.utils.helpers import merge_dicts

if TYPE_CHECKING:
Expand Down
4 changes: 3 additions & 1 deletion providers/http/src/airflow/providers/http/sensors/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@

from airflow.configuration import conf
from airflow.exceptions import AirflowException
from airflow.providers.common.compat.sdk import BaseSensorOperator
from airflow.providers.http.hooks.http import HttpHook
from airflow.providers.http.triggers.http import HttpSensorTrigger
from airflow.providers.http.version_compat import AIRFLOW_V_3_0_PLUS, BaseSensorOperator

if TYPE_CHECKING:
from airflow.providers.common.compat.version_compat import AIRFLOW_V_3_0_PLUS

try:
from airflow.sdk.definitions.context import Context

Expand Down
2 changes: 1 addition & 1 deletion providers/http/src/airflow/providers/http/triggers/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
from requests.structures import CaseInsensitiveDict

from airflow.exceptions import AirflowException
from airflow.providers.common.compat.version_compat import AIRFLOW_V_3_0_PLUS
from airflow.providers.http.hooks.http import HttpAsyncHook
from airflow.providers.http.version_compat import AIRFLOW_V_3_0_PLUS
from airflow.triggers.base import BaseTrigger, TriggerEvent

if AIRFLOW_V_3_0_PLUS:
Expand Down
17 changes: 4 additions & 13 deletions providers/http/src/airflow/providers/http/version_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,9 @@ 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
else:
from airflow.models import BaseOperator
from airflow.sensors.base import BaseSensorOperator # type: ignore[no-redef]

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