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 e01323635a Add deprecation info to the providers modules and classes
docstring (#32536)
e01323635a is described below
commit e01323635a88ecf313a415ea41d32d6d28fa0794
Author: Hussein Awala <[email protected]>
AuthorDate: Thu Jul 13 16:30:09 2023 +0200
Add deprecation info to the providers modules and classes docstring (#32536)
* Add deprecation info to providers modules and classes docstring
Signed-off-by: Hussein Awala <[email protected]>
---------
Signed-off-by: Hussein Awala <[email protected]>
---
airflow/providers/apache/drill/operators/drill.py | 4 ++++
airflow/providers/apache/druid/operators/druid_check.py | 2 +-
.../providers/cncf/kubernetes/operators/kubernetes_pod.py | 1 +
airflow/providers/cncf/kubernetes/triggers/kubernetes_pod.py | 1 +
airflow/providers/elasticsearch/hooks/elasticsearch.py | 2 +-
airflow/providers/google/cloud/operators/dataflow.py | 2 ++
airflow/providers/google/cloud/sensors/bigquery.py | 12 +++++++++++-
airflow/providers/google/cloud/sensors/gcs.py | 6 ++++--
airflow/providers/jdbc/operators/jdbc.py | 4 ++++
airflow/providers/microsoft/azure/sensors/data_factory.py | 6 ++++++
airflow/providers/microsoft/azure/sensors/wasb.py | 5 +++++
airflow/providers/microsoft/azure/transfers/local_to_adls.py | 3 ++-
airflow/providers/microsoft/mssql/operators/mssql.py | 4 ++++
airflow/providers/mysql/operators/mysql.py | 4 ++++
airflow/providers/oracle/operators/oracle.py | 4 ++++
airflow/providers/postgres/operators/postgres.py | 4 ++++
airflow/providers/snowflake/operators/snowflake.py | 4 ++++
airflow/providers/sqlite/operators/sqlite.py | 4 ++++
airflow/providers/trino/operators/trino.py | 4 ++++
airflow/providers/vertica/operators/vertica.py | 4 ++++
tests/providers/google/cloud/sensors/test_bigquery.py | 2 +-
21 files changed, 75 insertions(+), 7 deletions(-)
diff --git a/airflow/providers/apache/drill/operators/drill.py
b/airflow/providers/apache/drill/operators/drill.py
index 3ab760b6db..e654d6b6a5 100644
--- a/airflow/providers/apache/drill/operators/drill.py
+++ b/airflow/providers/apache/drill/operators/drill.py
@@ -28,6 +28,10 @@ class DrillOperator(SQLExecuteQueryOperator):
"""
Executes the provided SQL in the identified Drill environment.
+ 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:DrillOperator`
diff --git a/airflow/providers/apache/druid/operators/druid_check.py
b/airflow/providers/apache/druid/operators/druid_check.py
index 25813384c2..c6bf855cf6 100644
--- a/airflow/providers/apache/druid/operators/druid_check.py
+++ b/airflow/providers/apache/druid/operators/druid_check.py
@@ -27,7 +27,7 @@ class DruidCheckOperator(SQLCheckOperator):
"""
This class is deprecated.
- Please use `airflow.providers.common.sql.operators.sql.SQLCheckOperator`.
+ Please use
:class:`airflow.providers.common.sql.operators.sql.SQLCheckOperator`.
"""
def __init__(self, druid_broker_conn_id: str = "druid_broker_default",
**kwargs):
diff --git a/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
b/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
index 0c593a17bf..36993895bc 100644
--- a/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
+++ b/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
@@ -15,6 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+"""This module is deprecated. Please use
:mod:`airflow.providers.cncf.kubernetes.operators.pod` instead."""
from __future__ import annotations
import warnings
diff --git a/airflow/providers/cncf/kubernetes/triggers/kubernetes_pod.py
b/airflow/providers/cncf/kubernetes/triggers/kubernetes_pod.py
index 83ece6c0be..3cb60f7bd1 100644
--- a/airflow/providers/cncf/kubernetes/triggers/kubernetes_pod.py
+++ b/airflow/providers/cncf/kubernetes/triggers/kubernetes_pod.py
@@ -15,6 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+"""This module is deprecated. Please use
:mod:`airflow.providers.cncf.kubernetes.triggers.pod` instead."""
from __future__ import annotations
import warnings
diff --git a/airflow/providers/elasticsearch/hooks/elasticsearch.py
b/airflow/providers/elasticsearch/hooks/elasticsearch.py
index 978eac8f5c..c3a792eb69 100644
--- a/airflow/providers/elasticsearch/hooks/elasticsearch.py
+++ b/airflow/providers/elasticsearch/hooks/elasticsearch.py
@@ -142,7 +142,7 @@ class ElasticsearchHook(ElasticsearchSQLHook):
"""
This class is deprecated and was renamed to ElasticsearchSQLHook.
- Please use
`airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchSQLHook`.
+ Please use
:class:`airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchSQLHook`.
"""
def __init__(self, *args, **kwargs):
diff --git a/airflow/providers/google/cloud/operators/dataflow.py
b/airflow/providers/google/cloud/operators/dataflow.py
index 0a225a47b6..e6710c9f9a 100644
--- a/airflow/providers/google/cloud/operators/dataflow.py
+++ b/airflow/providers/google/cloud/operators/dataflow.py
@@ -173,6 +173,7 @@ class
DataflowCreateJavaJobOperator(GoogleCloudBaseOperator):
Start a Java Cloud Dataflow batch job; the parameters of the operation
will be passed to the job.
This class is deprecated.
+
Please use
:class:`providers.apache.beam.operators.beam.BeamRunJavaPipelineOperator`.
Example usage:
@@ -1023,6 +1024,7 @@ class
DataflowCreatePythonJobOperator(GoogleCloudBaseOperator):
for instances, project and zone information, which apply to all dataflow
operators in the DAG.
This class is deprecated.
+
Please use
:class:`providers.apache.beam.operators.beam.BeamRunPythonPipelineOperator`.
.. seealso::
diff --git a/airflow/providers/google/cloud/sensors/bigquery.py
b/airflow/providers/google/cloud/sensors/bigquery.py
index d13748da18..d4f15fac1b 100644
--- a/airflow/providers/google/cloud/sensors/bigquery.py
+++ b/airflow/providers/google/cloud/sensors/bigquery.py
@@ -256,6 +256,11 @@ class
BigQueryTableExistenceAsyncSensor(BigQueryTableExistenceSensor):
"""
Checks for the existence of a table in Google Big Query.
+ This class is deprecated and will be removed in a future release.
+
+ Please use
:class:`airflow.providers.google.cloud.sensors.bigquery.BigQueryTableExistenceSensor`
+ and set *deferrable* attribute to *True* instead.
+
:param project_id: The Google cloud project in which to look for the table.
The connection supplied to the hook must provide
access to the specified project.
@@ -291,6 +296,11 @@ class
BigQueryTableExistencePartitionAsyncSensor(BigQueryTablePartitionExistence
"""
Checks for the existence of a partition within a table in Google BigQuery.
+ This class is deprecated and will be removed in a future release.
+
+ Please use
:class:`airflow.providers.google.cloud.sensors.bigquery.BigQueryTablePartitionExistenceSensor`
+ and set *deferrable* attribute to *True* instead.
+
:param project_id: The Google cloud project in which to look for the table.
The connection supplied to the hook must provide
access to the specified project.
@@ -316,7 +326,7 @@ class
BigQueryTableExistencePartitionAsyncSensor(BigQueryTablePartitionExistence
warnings.warn(
"Class `BigQueryTableExistencePartitionAsyncSensor` is deprecated
and "
"will be removed in a future release. "
- "Please use `BigQueryTableExistencePartitionSensor` and "
+ "Please use `BigQueryTablePartitionExistenceSensor` and "
"set `deferrable` attribute to `True` instead",
AirflowProviderDeprecationWarning,
)
diff --git a/airflow/providers/google/cloud/sensors/gcs.py
b/airflow/providers/google/cloud/sensors/gcs.py
index 34df5f5257..e427d1c6be 100644
--- a/airflow/providers/google/cloud/sensors/gcs.py
+++ b/airflow/providers/google/cloud/sensors/gcs.py
@@ -133,8 +133,10 @@ class
GCSObjectExistenceAsyncSensor(GCSObjectExistenceSensor):
"""
Checks for the existence of a file in Google Cloud Storage.
- Class `GCSObjectExistenceAsyncSensor` is deprecated and will be removed in
a future release.
- Please use `GCSObjectExistenceSensor` and set `deferrable` attribute to
`True` instead.
+ This class is deprecated and will be removed in a future release.
+
+ Please use
:class:`airflow.providers.google.cloud.sensors.gcs.GCSObjectExistenceSensor`
+ and set *deferrable* attribute to *True* instead.
:param bucket: The Google Cloud Storage bucket where the object is.
:param object: The name of the object to check in the Google cloud storage
bucket.
diff --git a/airflow/providers/jdbc/operators/jdbc.py
b/airflow/providers/jdbc/operators/jdbc.py
index 4e94d69ba7..fae69b2af4 100644
--- a/airflow/providers/jdbc/operators/jdbc.py
+++ b/airflow/providers/jdbc/operators/jdbc.py
@@ -30,6 +30,10 @@ class JdbcOperator(SQLExecuteQueryOperator):
Requires jaydebeapi.
+ This class is deprecated.
+
+ Please use
:class:`airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`
instead.
+
.. seealso::
For more information on how to use this operator, take a look at the
guide:
:ref:`howto/operator:JdbcOperator`
diff --git a/airflow/providers/microsoft/azure/sensors/data_factory.py
b/airflow/providers/microsoft/azure/sensors/data_factory.py
index f0651494bf..4caa26a99d 100644
--- a/airflow/providers/microsoft/azure/sensors/data_factory.py
+++ b/airflow/providers/microsoft/azure/sensors/data_factory.py
@@ -127,6 +127,12 @@ class
AzureDataFactoryPipelineRunStatusAsyncSensor(AzureDataFactoryPipelineRunSt
"""
Checks the status of a pipeline run asynchronously.
+ This class is deprecated and will be removed in a future release.
+
+ Please use
+
:class:`airflow.providers.microsoft.azure.sensors.data_factory.AzureDataFactoryPipelineRunStatusSensor`
+ and set *deferrable* attribute to *True* instead.
+
:param azure_data_factory_conn_id: The connection identifier for
connecting to Azure Data Factory.
:param run_id: The pipeline run identifier.
:param resource_group_name: The resource group name.
diff --git a/airflow/providers/microsoft/azure/sensors/wasb.py
b/airflow/providers/microsoft/azure/sensors/wasb.py
index 18ac2331e0..5abd88a129 100644
--- a/airflow/providers/microsoft/azure/sensors/wasb.py
+++ b/airflow/providers/microsoft/azure/sensors/wasb.py
@@ -112,6 +112,11 @@ class WasbBlobAsyncSensor(WasbBlobSensor):
"""
Polls asynchronously for the existence of a blob in a WASB container.
+ This class is deprecated and will be removed in a future release.
+
+ Please use
:class:`airflow.providers.microsoft.azure.sensors.wasb.WasbBlobSensor`
+ and set *deferrable* attribute to *True* instead.
+
:param container_name: name of the container in which the blob should be
searched for
:param blob_name: name of the blob to check existence for
:param wasb_conn_id: the connection identifier for connecting to Azure WASB
diff --git a/airflow/providers/microsoft/azure/transfers/local_to_adls.py
b/airflow/providers/microsoft/azure/transfers/local_to_adls.py
index 7eee5009af..dc65857c7c 100644
--- a/airflow/providers/microsoft/azure/transfers/local_to_adls.py
+++ b/airflow/providers/microsoft/azure/transfers/local_to_adls.py
@@ -103,7 +103,8 @@ class
LocalToAzureDataLakeStorageOperator(LocalFilesystemToADLSOperator):
"""
This class is deprecated.
- Please use
`airflow.providers.microsoft.azure.transfers.local_to_adls.LocalFilesystemToADLSOperator`.
+ Please use
+
:class:`airflow.providers.microsoft.azure.transfers.local_to_adls.LocalFilesystemToADLSOperator`.
"""
def __init__(self, *args, **kwargs):
diff --git a/airflow/providers/microsoft/mssql/operators/mssql.py
b/airflow/providers/microsoft/mssql/operators/mssql.py
index 043162f3eb..dc06b36c9a 100644
--- a/airflow/providers/microsoft/mssql/operators/mssql.py
+++ b/airflow/providers/microsoft/mssql/operators/mssql.py
@@ -37,6 +37,10 @@ class MsSqlOperator(SQLExecuteQueryOperator):
If conn_type is ``'odbc'``, then
:py:class:`~airflow.providers.odbc.hooks.odbc.OdbcHook`
is used. Otherwise,
:py:class:`~airflow.providers.microsoft.mssql.hooks.mssql.MsSqlHook` is used.
+ This class is deprecated.
+
+ Please use
:class:`airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`.
+
:param sql: the sql code to be executed (templated)
:param mssql_conn_id: reference to a specific mssql database
:param parameters: (optional) the parameters to render the SQL query with.
diff --git a/airflow/providers/mysql/operators/mysql.py
b/airflow/providers/mysql/operators/mysql.py
index b21c9cdaf4..7c8e1a09a4 100644
--- a/airflow/providers/mysql/operators/mysql.py
+++ b/airflow/providers/mysql/operators/mysql.py
@@ -28,6 +28,10 @@ class MySqlOperator(SQLExecuteQueryOperator):
"""
Executes sql code in a specific MySQL 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:MySqlOperator`
diff --git a/airflow/providers/oracle/operators/oracle.py
b/airflow/providers/oracle/operators/oracle.py
index 53396db986..87bd7494b9 100644
--- a/airflow/providers/oracle/operators/oracle.py
+++ b/airflow/providers/oracle/operators/oracle.py
@@ -36,6 +36,10 @@ class OracleOperator(SQLExecuteQueryOperator):
"""
Executes sql code in a specific Oracle database.
+ This class is deprecated.
+
+ Please use
:class:`airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`.
+
: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'
diff --git a/airflow/providers/postgres/operators/postgres.py
b/airflow/providers/postgres/operators/postgres.py
index ef92b51dda..71f49ef7f8 100644
--- a/airflow/providers/postgres/operators/postgres.py
+++ b/airflow/providers/postgres/operators/postgres.py
@@ -28,6 +28,10 @@ class PostgresOperator(SQLExecuteQueryOperator):
"""
Executes sql code in a specific Postgres database.
+ This class is deprecated.
+
+ Please use
:class:`airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`.
+
:param sql: the SQL code to be executed as a single string, or
a list of str (sql statements), or a reference to a template file.
Template references are recognized by str ending in '.sql'
diff --git a/airflow/providers/snowflake/operators/snowflake.py
b/airflow/providers/snowflake/operators/snowflake.py
index 61e60b5781..29b57e54eb 100644
--- a/airflow/providers/snowflake/operators/snowflake.py
+++ b/airflow/providers/snowflake/operators/snowflake.py
@@ -42,6 +42,10 @@ class SnowflakeOperator(SQLExecuteQueryOperator):
"""
Executes SQL code in a Snowflake 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:SnowflakeOperator`
diff --git a/airflow/providers/sqlite/operators/sqlite.py
b/airflow/providers/sqlite/operators/sqlite.py
index 58642246d8..f764cc01eb 100644
--- a/airflow/providers/sqlite/operators/sqlite.py
+++ b/airflow/providers/sqlite/operators/sqlite.py
@@ -28,6 +28,10 @@ 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`
diff --git a/airflow/providers/trino/operators/trino.py
b/airflow/providers/trino/operators/trino.py
index 7affe22dc1..7f90bf9947 100644
--- a/airflow/providers/trino/operators/trino.py
+++ b/airflow/providers/trino/operators/trino.py
@@ -32,6 +32,10 @@ class TrinoOperator(SQLExecuteQueryOperator):
"""
Executes sql code using a specific Trino query Engine.
+ 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:TrinoOperator`
diff --git a/airflow/providers/vertica/operators/vertica.py
b/airflow/providers/vertica/operators/vertica.py
index 3ef8fea1fd..2316f1b074 100644
--- a/airflow/providers/vertica/operators/vertica.py
+++ b/airflow/providers/vertica/operators/vertica.py
@@ -28,6 +28,10 @@ class VerticaOperator(SQLExecuteQueryOperator):
"""
Executes sql code in a specific Vertica database.
+ This class is deprecated.
+
+ Please use
:class:`airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`.
+
:param vertica_conn_id: reference to a specific Vertica database
:param sql: the SQL code to be executed as a single string, or
a list of str (sql statements), or a reference to a template file.
diff --git a/tests/providers/google/cloud/sensors/test_bigquery.py
b/tests/providers/google/cloud/sensors/test_bigquery.py
index cd6f9b4942..5fe40227c5 100644
--- a/tests/providers/google/cloud/sensors/test_bigquery.py
+++ b/tests/providers/google/cloud/sensors/test_bigquery.py
@@ -330,7 +330,7 @@ class TestBigQueryTableExistencePartitionAsyncSensor:
depcrecation_message = (
"Class `BigQueryTableExistencePartitionAsyncSensor` is deprecated and "
"will be removed in a future release. "
- "Please use `BigQueryTableExistencePartitionSensor` and "
+ "Please use `BigQueryTablePartitionExistenceSensor` and "
"set `deferrable` attribute to `True` instead"
)