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 Provider Deprecations in Apache Livy #44631

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
11 changes: 11 additions & 0 deletions providers/src/airflow/providers/apache/livy/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
Changelog
---------

main
.....

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

* Operators

* Removed ``get_hook`` method from ``LivyOperator``. Use ``hook`` property instead

3.9.2
.....

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
from functools import cached_property
from typing import TYPE_CHECKING, Any

from deprecated.classic import deprecated

from airflow.configuration import conf
from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.providers.apache.livy.hooks.livy import BatchState, LivyHook
from airflow.providers.apache.livy.triggers.livy import LivyTrigger
Expand Down Expand Up @@ -143,11 +141,6 @@ def hook(self) -> LivyHook:
auth_type=self._livy_conn_auth_type,
)

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

def execute(self, context: Context) -> Any:
self._batch_id = self.hook.post_batch(**self.spark_params)
self.log.info("Generated batch-id is %s", self._batch_id)
Expand Down
8 changes: 1 addition & 7 deletions providers/tests/apache/livy/operators/test_livy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import pytest

from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
from airflow.exceptions import AirflowException
from airflow.models import Connection
from airflow.models.dag import DAG
from airflow.providers.apache.livy.hooks.livy import BatchState
Expand Down Expand Up @@ -417,12 +417,6 @@ def test_execute_complete_timeout(self, mock_delete, mock_post):
mock_delete.assert_called_once_with(BATCH_ID)
self.mock_context["ti"].xcom_push.assert_not_called()

def test_deprecated_get_hook(self):
op = LivyOperator(task_id="livy_example", file="sparkapp")
with pytest.warns(AirflowProviderDeprecationWarning, match="use `hook` property instead"):
hook = op.get_hook()
assert hook is op.hook


@pytest.mark.db_test
def test_spark_params_templating(create_task_instance_of_operator, session):
Expand Down