This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 6f1351122df Remove Provider Deprecations in Apache Livy (#44631)
6f1351122df is described below
commit 6f1351122dfcbefd15d6414aa3e4a8b8416aba6e
Author: LIU ZHE YOU <[email protected]>
AuthorDate: Wed Dec 4 13:54:35 2024 +0800
Remove Provider Deprecations in Apache Livy (#44631)
---
providers/src/airflow/providers/apache/livy/CHANGELOG.rst | 11 +++++++++++
providers/src/airflow/providers/apache/livy/operators/livy.py | 9 +--------
providers/tests/apache/livy/operators/test_livy.py | 8 +-------
3 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/providers/src/airflow/providers/apache/livy/CHANGELOG.rst
b/providers/src/airflow/providers/apache/livy/CHANGELOG.rst
index 386ffdfb648..c9133aee64d 100644
--- a/providers/src/airflow/providers/apache/livy/CHANGELOG.rst
+++ b/providers/src/airflow/providers/apache/livy/CHANGELOG.rst
@@ -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
.....
diff --git a/providers/src/airflow/providers/apache/livy/operators/livy.py
b/providers/src/airflow/providers/apache/livy/operators/livy.py
index 1390b46a7ad..ed63cdf3449 100644
--- a/providers/src/airflow/providers/apache/livy/operators/livy.py
+++ b/providers/src/airflow/providers/apache/livy/operators/livy.py
@@ -23,10 +23,8 @@ from collections.abc import Sequence
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
@@ -143,11 +141,6 @@ class LivyOperator(BaseOperator):
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)
diff --git a/providers/tests/apache/livy/operators/test_livy.py
b/providers/tests/apache/livy/operators/test_livy.py
index abec29badac..d9351007ec7 100644
--- a/providers/tests/apache/livy/operators/test_livy.py
+++ b/providers/tests/apache/livy/operators/test_livy.py
@@ -21,7 +21,7 @@ from unittest.mock import MagicMock, patch
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
@@ -417,12 +417,6 @@ class TestLivyOperator:
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):