Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated code from Airbyte provider #44577

Merged
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
9 changes: 9 additions & 0 deletions providers/src/airflow/providers/airbyte/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
Changelog
---------

main
.....

.. warning::
All deprecated classes, parameters, and features have been removed from the Airbyte provider package.
The following breaking changes were introduced:

* Removed ``polling_interval`` parameter from ``AirbyteJobSensor``. Use the ``poke_interval`` parameter instead.

4.0.0
.....

Expand Down
21 changes: 5 additions & 16 deletions providers/src/airflow/providers/airbyte/sensors/airbyte.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
from __future__ import annotations

import time
import warnings
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any

from airbyte_api.models import JobStatusEnum

from airflow.configuration import conf
from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
from airflow.exceptions import AirflowException
from airflow.providers.airbyte.hooks.airbyte import AirbyteHook
from airflow.providers.airbyte.triggers.airbyte import AirbyteSyncTrigger
from airflow.sensors.base import BaseSensorOperator
Expand Down Expand Up @@ -61,20 +60,10 @@ def __init__(
) -> None:
if deferrable:
if "poke_interval" not in kwargs:
# TODO: Remove once deprecated
if "polling_interval" in kwargs:
kwargs["poke_interval"] = kwargs["polling_interval"]
warnings.warn(
"Argument `poll_interval` is deprecated and will be removed "
"in a future release. Please use `poke_interval` instead.",
AirflowProviderDeprecationWarning,
stacklevel=2,
)
else:
kwargs["poke_interval"] = 5

if "timeout" not in kwargs:
kwargs["timeout"] = 60 * 60 * 24 * 7
kwargs["poke_interval"] = 5

if "timeout" not in kwargs:
kwargs["timeout"] = 60 * 60 * 24 * 7

super().__init__(**kwargs)
self.deferrable = deferrable
Expand Down
12 changes: 12 additions & 0 deletions providers/tests/airbyte/sensors/test_airbyte.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,15 @@ def test_cancelled(self, mock_get_job):
sensor.poke(context={})

mock_get_job.assert_called_once_with(request=GetJobRequest(job_id=self.job_id))

def test_airbyte_job_sensor_init(self):
"""Test initializing AirbyteJobSensor with `poke_interval`."""
sensor = AirbyteJobSensor(
task_id="test_sensor",
airbyte_job_id=1,
deferrable=True,
poke_interval=10,
timeout=3600,
)
assert sensor.poke_interval == 10
assert sensor.timeout == 3600