This is an automated email from the ASF dual-hosted git repository.

jscheffl 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 c73becd1a7b Remove Provider Deprecations in Sqlite (#44707)
c73becd1a7b is described below

commit c73becd1a7b5b38a5b0dfe0cb9d02b076bfe6f32
Author: Jens Scheffler <[email protected]>
AuthorDate: Sat Dec 7 10:13:10 2024 +0100

    Remove Provider Deprecations in Sqlite (#44707)
    
    * Remove Provider Deprecations in Sqlite
    
    * Adjust docs after deprecation
---
 docs/apache-airflow-providers-sqlite/operators.rst |  4 +-
 .../src/airflow/providers/sqlite/CHANGELOG.rst     | 13 ++++
 .../airflow/providers/sqlite/operators/__init__.py | 17 -----
 .../airflow/providers/sqlite/operators/sqlite.py   | 59 ---------------
 .../src/airflow/providers/sqlite/provider.yaml     |  6 --
 providers/tests/sqlite/operators/__init__.py       | 17 -----
 providers/tests/sqlite/operators/test_sqlite.py    | 85 ----------------------
 7 files changed, 15 insertions(+), 186 deletions(-)

diff --git a/docs/apache-airflow-providers-sqlite/operators.rst 
b/docs/apache-airflow-providers-sqlite/operators.rst
index 5b113162ae4..086192325cd 100644
--- a/docs/apache-airflow-providers-sqlite/operators.rst
+++ b/docs/apache-airflow-providers-sqlite/operators.rst
@@ -25,8 +25,8 @@ SQLExecuteQueryOperator to connect to Sqlite
 Use the 
:class:`SQLExecuteQueryOperator<airflow.providers.common.sql.operators.sql>` to 
execute
 Sqlite commands in a `Sqlite <https://sqlite.org/lang.html>`__ database.
 
-.. warning::
-    Previously, SqliteOperator was used to perform this kind of operation. But 
at the moment SqliteOperator is deprecated and will be removed in future 
versions of the provider. Please consider to switch to SQLExecuteQueryOperator 
as soon as possible.
+.. note::
+    Previously, ``SqliteOperator`` was used to perform this kind of operation. 
After deprecation this has been removed. Please use ``SQLExecuteQueryOperator`` 
instead.
 
 Using the Operator
 ^^^^^^^^^^^^^^^^^^
diff --git a/providers/src/airflow/providers/sqlite/CHANGELOG.rst 
b/providers/src/airflow/providers/sqlite/CHANGELOG.rst
index d69e9413164..33727da0ab1 100644
--- a/providers/src/airflow/providers/sqlite/CHANGELOG.rst
+++ b/providers/src/airflow/providers/sqlite/CHANGELOG.rst
@@ -27,6 +27,19 @@
 Changelog
 ---------
 
+main
+....
+
+Breaking changes
+~~~~~~~~~~~~~~~~
+
+.. warning::
+  All deprecated classes, parameters and features have been removed from the 
Sqlite provider package.
+  The following breaking changes were introduced:
+
+  * Operators
+     * Remove ``airflow.providers.sqlite.operators.sqlite.SqliteOperator``. 
Please use 
``airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator``.
+
 3.9.1
 .....
 
diff --git a/providers/src/airflow/providers/sqlite/operators/__init__.py 
b/providers/src/airflow/providers/sqlite/operators/__init__.py
deleted file mode 100644
index 217e5db9607..00000000000
--- a/providers/src/airflow/providers/sqlite/operators/__init__.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
diff --git a/providers/src/airflow/providers/sqlite/operators/sqlite.py 
b/providers/src/airflow/providers/sqlite/operators/sqlite.py
deleted file mode 100644
index 25df70c8abf..00000000000
--- a/providers/src/airflow/providers/sqlite/operators/sqlite.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-from __future__ import annotations
-
-from collections.abc import Sequence
-from typing import ClassVar
-
-from deprecated import deprecated
-
-from airflow.exceptions import AirflowProviderDeprecationWarning
-from airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator
-
-
-@deprecated(
-    reason="Please use 
`airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`.",
-    category=AirflowProviderDeprecationWarning,
-)
-class SqliteOperator(SQLExecuteQueryOperator):
-    """
-    Executes sql code in a specific Sqlite database.
-
-    This class is deprecated.
-
-    Please use 
:class:`airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`.
-
-    .. seealso::
-        For more information on how to use this operator, take a look at the 
guide:
-        :ref:`howto/operator:SqliteOperator`
-
-    :param sql: the sql code to be executed. Can receive a str representing a
-        sql statement, a list of str (sql statements), or reference to a 
template file.
-        Template reference are recognized by str ending in '.sql'
-        (templated)
-    :param sqlite_conn_id: reference to a specific sqlite database
-    :param parameters: (optional) the parameters to render the SQL query with.
-    """
-
-    template_fields: Sequence[str] = ("sql",)
-    template_ext: Sequence[str] = (".sql",)
-    template_fields_renderers: ClassVar[dict] = {"sql": "sql"}
-    ui_color = "#cdaaed"
-
-    def __init__(self, *, sqlite_conn_id: str = "sqlite_default", **kwargs) -> 
None:
-        super().__init__(conn_id=sqlite_conn_id, **kwargs)
diff --git a/providers/src/airflow/providers/sqlite/provider.yaml 
b/providers/src/airflow/providers/sqlite/provider.yaml
index 473c211966e..3ab2417cf2c 100644
--- a/providers/src/airflow/providers/sqlite/provider.yaml
+++ b/providers/src/airflow/providers/sqlite/provider.yaml
@@ -68,12 +68,6 @@ integrations:
     logo: /integration-logos/sqlite/SQLite.png
     tags: [software]
 
-operators:
-  - integration-name: SQLite
-
-    python-modules:
-      - airflow.providers.sqlite.operators.sqlite
-
 hooks:
   - integration-name: SQLite
     python-modules:
diff --git a/providers/tests/sqlite/operators/__init__.py 
b/providers/tests/sqlite/operators/__init__.py
deleted file mode 100644
index 217e5db9607..00000000000
--- a/providers/tests/sqlite/operators/__init__.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
diff --git a/providers/tests/sqlite/operators/test_sqlite.py 
b/providers/tests/sqlite/operators/test_sqlite.py
deleted file mode 100644
index 7b95c5d932a..00000000000
--- a/providers/tests/sqlite/operators/test_sqlite.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-from __future__ import annotations
-
-import pytest
-
-from airflow.models.dag import DAG
-from airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator
-from airflow.utils import timezone
-
-DEFAULT_DATE = timezone.datetime(2015, 1, 1)
-DEFAULT_DATE_ISO = DEFAULT_DATE.isoformat()
-DEFAULT_DATE_DS = DEFAULT_DATE_ISO[:10]
-TEST_DAG_ID = "unit_test_dag"
-
-
[email protected]("sqlite")
-class TestSqliteOperator:
-    def setup_method(self):
-        args = {"owner": "airflow", "start_date": DEFAULT_DATE}
-        dag = DAG(TEST_DAG_ID, schedule=None, default_args=args)
-        self.dag = dag
-
-    def teardown_method(self):
-        tables_to_drop = ["test_airflow", "test_airflow2"]
-        from airflow.providers.sqlite.hooks.sqlite import SqliteHook
-
-        with SqliteHook().get_conn() as conn:
-            cur = conn.cursor()
-            for table in tables_to_drop:
-                cur.execute(f"DROP TABLE IF EXISTS {table}")
-
-    def test_sqlite_operator_with_one_statement(self):
-        sql = """
-        CREATE TABLE IF NOT EXISTS test_airflow (
-            dummy VARCHAR(50)
-        );
-        """
-        op = SQLExecuteQueryOperator(task_id="basic_sqlite", sql=sql, 
dag=self.dag, conn_id="sqlite_default")
-        op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, 
ignore_ti_state=True)
-
-    def test_sqlite_operator_with_multiple_statements(self):
-        sql = [
-            "CREATE TABLE IF NOT EXISTS test_airflow (dummy VARCHAR(50))",
-            "INSERT INTO test_airflow VALUES ('X')",
-        ]
-        op = SQLExecuteQueryOperator(
-            task_id="sqlite_operator_with_multiple_statements",
-            sql=sql,
-            dag=self.dag,
-            conn_id="sqlite_default",
-        )
-        op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, 
ignore_ti_state=True)
-
-    def test_sqlite_operator_with_invalid_sql(self):
-        sql = [
-            "CREATE TABLE IF NOT EXISTS test_airflow (dummy VARCHAR(50))",
-            "INSERT INTO test_airflow2 VALUES ('X')",
-        ]
-
-        from sqlite3 import OperationalError
-
-        op = SQLExecuteQueryOperator(
-            task_id="sqlite_operator_with_multiple_statements",
-            sql=sql,
-            dag=self.dag,
-            conn_id="sqlite_default",
-        )
-        with pytest.raises(OperationalError, match="no such table: 
test_airflow2"):
-            op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, 
ignore_ti_state=True)

Reply via email to