Skip to content

Commit

Permalink
Removed deprecated code from Alibaba provider package (#44576)
Browse files Browse the repository at this point in the history
* issue 44559

removed depricated code from alibaba provider

* Apply suggestions from code review

Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>

---------

Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com>
Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 16, 2024
1 parent 13a18c3 commit 33a809c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
14 changes: 14 additions & 0 deletions providers/src/airflow/providers/alibaba/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@
Changelog
---------



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

* Operators
* Remove ``get_hook`` method from ``AnalyticDBSparkBaseOperator``. Use ``self.hook`` instead.

* sensors
* Remove ``get_hook`` method from ``AnalyticDBSparkSensor``. Use ``self.hook`` instead.



2.9.1
.....

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
from functools import cached_property
from typing import TYPE_CHECKING, Any

from deprecated.classic import deprecated

from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.providers.alibaba.cloud.hooks.analyticdb_spark import AnalyticDBSparkHook, AppState

Expand Down Expand Up @@ -56,11 +54,6 @@ def hook(self) -> AnalyticDBSparkHook:
"""Get valid hook."""
return AnalyticDBSparkHook(adb_spark_conn_id=self._adb_spark_conn_id, region=self._region)

@deprecated(reason="use `hook` property instead.", category=AirflowProviderDeprecationWarning)
def get_hook(self) -> AnalyticDBSparkHook:
"""Get valid hook."""
return self.hook

def execute(self, context: Context) -> Any: ...

def monitor_application(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
from functools import cached_property
from typing import TYPE_CHECKING, Any

from deprecated.classic import deprecated

from airflow.exceptions import AirflowProviderDeprecationWarning
from airflow.providers.alibaba.cloud.hooks.analyticdb_spark import AnalyticDBSparkHook, AppState
from airflow.sensors.base import BaseSensorOperator

Expand Down Expand Up @@ -60,11 +57,6 @@ def hook(self) -> AnalyticDBSparkHook:
"""Get valid hook."""
return AnalyticDBSparkHook(adb_spark_conn_id=self._adb_spark_conn_id, region=self._region)

@deprecated(reason="use `hook` property instead.", category=AirflowProviderDeprecationWarning)
def get_hook(self) -> AnalyticDBSparkHook:
"""Get valid hook."""
return self.hook

def poke(self, context: Context) -> bool:
app_id = self.app_id

Expand Down

0 comments on commit 33a809c

Please sign in to comment.