This is an automated email from the ASF dual-hosted git repository.
potiuk 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 fad4c389ed1 Remove deprecated code from apache spark provider (#44567)
fad4c389ed1 is described below
commit fad4c389ed1975fddc5148787f0f63df9bb7b28a
Author: Kunal Bhattacharya <[email protected]>
AuthorDate: Fri Dec 6 12:40:26 2024 +0530
Remove deprecated code from apache spark provider (#44567)
---
providers/src/airflow/providers/apache/spark/CHANGELOG.rst | 14 ++++++++++++++
.../airflow/providers/apache/spark/operators/spark_sql.py | 12 ------------
providers/tests/apache/spark/operators/test_spark_sql.py | 5 -----
3 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/providers/src/airflow/providers/apache/spark/CHANGELOG.rst
b/providers/src/airflow/providers/apache/spark/CHANGELOG.rst
index 919fbd473a5..6e6ac995520 100644
--- a/providers/src/airflow/providers/apache/spark/CHANGELOG.rst
+++ b/providers/src/airflow/providers/apache/spark/CHANGELOG.rst
@@ -29,6 +29,20 @@
Changelog
---------
+main
+.....
+
+.. warning::
+ All deprecated classes, parameters and features have been removed from the
Apache Spark provider package.
+ The following breaking changes were introduced:
+
+ * Operators
+
+ * Removed ``_sql()`` support for SparkSqlOperator. Please use ``sql``
attribute instead. ``_sql`` was
+ introduced in 2016 and since it was listed as templated field, which is
no longer the case, we
+ handled it as public api despite the ``_`` prefix that marked it as
private.
+
+
4.11.3
......
diff --git
a/providers/src/airflow/providers/apache/spark/operators/spark_sql.py
b/providers/src/airflow/providers/apache/spark/operators/spark_sql.py
index ad535c62d5e..b2de5d0cb23 100644
--- a/providers/src/airflow/providers/apache/spark/operators/spark_sql.py
+++ b/providers/src/airflow/providers/apache/spark/operators/spark_sql.py
@@ -20,9 +20,6 @@ from __future__ import annotations
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any
-from deprecated import deprecated
-
-from airflow.exceptions import AirflowProviderDeprecationWarning
from airflow.models import BaseOperator
from airflow.providers.apache.spark.hooks.spark_sql import SparkSqlHook
@@ -94,15 +91,6 @@ class SparkSqlOperator(BaseOperator):
self._yarn_queue = yarn_queue
self._hook: SparkSqlHook | None = None
- @property
- @deprecated(
- reason="`_sql` is deprecated and will be removed in the future. Please
use `sql` instead.",
- category=AirflowProviderDeprecationWarning,
- )
- def _sql(self):
- """Alias for ``sql``, used for compatibility (deprecated)."""
- return self.sql
-
def execute(self, context: Context) -> None:
"""Call the SparkSqlHook to run the provided sql query."""
if self._hook is None:
diff --git a/providers/tests/apache/spark/operators/test_spark_sql.py
b/providers/tests/apache/spark/operators/test_spark_sql.py
index 9154ba349bf..bfaf950e70f 100644
--- a/providers/tests/apache/spark/operators/test_spark_sql.py
+++ b/providers/tests/apache/spark/operators/test_spark_sql.py
@@ -19,7 +19,6 @@ from __future__ import annotations
import pytest
-from airflow.exceptions import AirflowProviderDeprecationWarning
from airflow.models.dag import DAG
from airflow.providers.apache.spark.operators.spark_sql import SparkSqlOperator
from airflow.utils import timezone
@@ -82,7 +81,3 @@ class TestSparkSqlOperator:
ti.render_templates()
task: SparkSqlOperator = ti.task
assert task.sql == "sql"
-
- # Deprecated aliases
- with pytest.warns(AirflowProviderDeprecationWarning):
- assert task._sql == "sql"