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
24 changes: 17 additions & 7 deletions dev/breeze/tests/test_selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ def assert_outputs_are_printed(expected_outputs: dict[str, str], stderr: str):
"providers/airbyte/tests/file.py",
),
{
"selected-providers-list-as-string": "airbyte",
"selected-providers-list-as-string": "airbyte common.compat",
"all-python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']",
"all-python-versions-list-as-string": DEFAULT_PYTHON_MAJOR_MINOR_VERSION,
"python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']",
Expand All @@ -749,7 +749,12 @@ def assert_outputs_are_printed(expected_outputs: dict[str, str], stderr: str):
[{"description": "Always", "test_types": "Always"}]
),
"providers-test-types-list-as-strings-in-json": json.dumps(
[{"description": "airbyte", "test_types": "Providers[airbyte]"}]
[
{
"description": "airbyte,common.compat",
"test_types": "Providers[airbyte,common.compat]",
}
]
),
},
id="Helm tests, airbyte providers, kubernetes tests and "
Expand Down Expand Up @@ -857,7 +862,7 @@ def assert_outputs_are_printed(expected_outputs: dict[str, str], stderr: str):
pytest.param(
("providers/airbyte/tests/airbyte/__init__.py",),
{
"selected-providers-list-as-string": "airbyte",
"selected-providers-list-as-string": "airbyte common.compat",
"all-python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']",
"all-python-versions-list-as-string": DEFAULT_PYTHON_MAJOR_MINOR_VERSION,
"python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']",
Expand All @@ -875,7 +880,12 @@ def assert_outputs_are_printed(expected_outputs: dict[str, str], stderr: str):
[{"description": "Always", "test_types": "Always"}]
),
"providers-test-types-list-as-strings-in-json": json.dumps(
[{"description": "airbyte", "test_types": "Providers[airbyte]"}]
[
{
"description": "airbyte,common.compat",
"test_types": "Providers[airbyte,common.compat]",
}
]
),
"run-mypy": "true",
"mypy-checks": "['mypy-providers']",
Expand Down Expand Up @@ -2125,14 +2135,14 @@ def test_upgrade_to_newer_dependencies(
pytest.param(
("providers/airbyte/docs/some_file.rst",),
{
"docs-list-as-string": "airbyte",
"docs-list-as-string": "airbyte common.compat",
},
id="Airbyte provider docs changed",
),
pytest.param(
("providers/airbyte/docs/some_file.rst", "airflow-core/docs/docs.rst"),
{
"docs-list-as-string": "apache-airflow airbyte",
"docs-list-as-string": "apache-airflow airbyte common.compat",
},
id="Airbyte provider and airflow core docs changed",
),
Expand All @@ -2143,7 +2153,7 @@ def test_upgrade_to_newer_dependencies(
"providers-summary-docs/docs.rst",
),
{
"docs-list-as-string": "apache-airflow apache-airflow-providers airbyte",
"docs-list-as-string": "apache-airflow apache-airflow-providers airbyte common.compat",
},
id="Airbyte provider and airflow core and common provider docs changed",
),
Expand Down
2 changes: 2 additions & 0 deletions providers/airbyte/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
"airbyte-api>=0.52.0",
"requests>=2.32.0",
]
Expand All @@ -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)
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from requests import Session

from airflow.exceptions import AirflowException
from airflow.providers.airbyte.version_compat import BaseHook
from airflow.providers.common.compat.sdk import BaseHook

T = TypeVar("T", bound=Any)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
from airflow.exceptions import AirflowException
from airflow.providers.airbyte.hooks.airbyte import AirbyteHook
from airflow.providers.airbyte.triggers.airbyte import AirbyteSyncTrigger
from airflow.providers.airbyte.version_compat import BaseOperator
from airflow.providers.common.compat.sdk import BaseOperator

if TYPE_CHECKING:
from airflow.providers.airbyte.version_compat import Context
from airflow.providers.common.compat.sdk import Context


class AirbyteTriggerSyncOperator(BaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
from airflow.exceptions import AirflowException
from airflow.providers.airbyte.hooks.airbyte import AirbyteHook
from airflow.providers.airbyte.triggers.airbyte import AirbyteSyncTrigger
from airflow.providers.airbyte.version_compat import BaseSensorOperator
from airflow.providers.common.compat.sdk import BaseSensorOperator

if TYPE_CHECKING:
from airflow.providers.airbyte.version_compat import Context
from airflow.providers.common.compat.sdk import Context


class AirbyteJobSensor(BaseSensorOperator):
Expand Down
17 changes: 0 additions & 17 deletions providers/airbyte/src/airflow/providers/airbyte/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",
]
Loading