From 35000c91ea7b2ce0851a8af117fdfc3683ec07bb Mon Sep 17 00:00:00 2001 From: Omkar P <45419097+omkar-foss@users.noreply.github.com> Date: Fri, 29 Nov 2024 22:10:56 +0530 Subject: [PATCH] Show prominent warning for deprecations in docs (#44479) * Show prominent warning for deprecations in docs * Change position of warning block --- .../operators/cloud/automl.rst | 33 ++++--- .../operators/cloud/datapipeline.rst | 6 +- .../operators/cloud/mlengine.rst | 77 ++++++++------- .../production-deployment.rst | 2 +- .../installation/setting-up-the-database.rst | 2 +- .../apache-airflow/installation/upgrading.rst | 2 +- .../google/cloud/operators/automl.py | 99 ++++++++++--------- .../google/cloud/operators/mlengine.py | 72 ++++++++------ .../cloud/transfers/bigquery_to_mssql.py | 3 + .../cloud/transfers/bigquery_to_mysql.py | 3 + 10 files changed, 170 insertions(+), 129 deletions(-) diff --git a/docs/apache-airflow-providers-google/operators/cloud/automl.rst b/docs/apache-airflow-providers-google/operators/cloud/automl.rst index 654589ed1404f..b93b8d8cf75ff 100644 --- a/docs/apache-airflow-providers-google/operators/cloud/automl.rst +++ b/docs/apache-airflow-providers-google/operators/cloud/automl.rst @@ -41,10 +41,11 @@ To create a Google AutoML dataset you can use :class:`~airflow.providers.google.cloud.operators.automl.AutoMLCreateDatasetOperator`. The operator returns dataset id in :ref:`XCom ` under ``dataset_id`` key. -This operator is deprecated when running for text, video and vision prediction and will be removed soon. -All the functionality of legacy AutoML Natural Language, Vision, Video Intelligence and new features are -available on the Vertex AI platform. Please use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.dataset.CreateDatasetOperator` +.. warning:: + This operator is deprecated when running for text, video and vision prediction and will be removed soon. + All the functionality of legacy AutoML Natural Language, Vision, Video Intelligence and new features are + available on the Vertex AI platform. Please use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.dataset.CreateDatasetOperator` .. exampleinclude:: /../../providers/tests/system/google/cloud/automl/example_automl_dataset.py :language: python @@ -64,10 +65,11 @@ After creating a dataset you can use it to import some data using To update dataset you can use :class:`~airflow.providers.google.cloud.operators.automl.AutoMLTablesUpdateDatasetOperator`. -This operator is deprecated when running for text, video and vision prediction and will be removed soon. -All the functionality of legacy AutoML Natural Language, Vision, Video Intelligence and new features are -available on the Vertex AI platform. Please use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.dataset.UpdateDatasetOperator` +.. warning:: + This operator is deprecated when running for text, video and vision prediction and will be removed soon. + All the functionality of legacy AutoML Natural Language, Vision, Video Intelligence and new features are + available on the Vertex AI platform. Please use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.dataset.UpdateDatasetOperator` .. exampleinclude:: /../../providers/tests/system/google/cloud/vertex_ai/example_vertex_ai_dataset.py :language: python @@ -102,14 +104,15 @@ To create a Google AutoML model you can use The operator will wait for the operation to complete. Additionally the operator returns the id of model in :ref:`XCom ` under ``model_id`` key. -This operator is deprecated when running for text, video and vision prediction and will be removed soon. -All the functionality of legacy AutoML Natural Language, Vision, Video Intelligence and new features are -available on the Vertex AI platform. Please use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.generative_model.SupervisedFineTuningTrainOperator`, -:class:`~airflow.providers.google.cloud.operators.vertex_ai.auto_ml.CreateAutoMLImageTrainingJobOperator` or -:class:`~airflow.providers.google.cloud.operators.vertex_ai.auto_ml.CreateAutoMLVideoTrainingJobOperator`. +.. warning:: + This operator is deprecated when running for text, video and vision prediction and will be removed soon. + All the functionality of legacy AutoML Natural Language, Vision, Video Intelligence and new features are + available on the Vertex AI platform. Please use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.generative_model.SupervisedFineTuningTrainOperator`, + :class:`~airflow.providers.google.cloud.operators.vertex_ai.auto_ml.CreateAutoMLImageTrainingJobOperator` or + :class:`~airflow.providers.google.cloud.operators.vertex_ai.auto_ml.CreateAutoMLVideoTrainingJobOperator`. -You can find example on how to use VertexAI operators for AutoML Vision classification here: + You can find example on how to use VertexAI operators for AutoML Vision classification here: .. exampleinclude:: /../../providers/tests/system/google/cloud/automl/example_automl_vision_classification.py :language: python diff --git a/docs/apache-airflow-providers-google/operators/cloud/datapipeline.rst b/docs/apache-airflow-providers-google/operators/cloud/datapipeline.rst index 1123c48d6d792..4996afaf7c323 100644 --- a/docs/apache-airflow-providers-google/operators/cloud/datapipeline.rst +++ b/docs/apache-airflow-providers-google/operators/cloud/datapipeline.rst @@ -33,7 +33,8 @@ Prerequisite Tasks Creating a Data Pipeline ^^^^^^^^^^^^^^^^^^^^^^^^ -This operator is deprecated. Please use :class:`~airflow.providers.google.cloud.operators.dataflow.DataflowCreatePipelineOperator`. +.. warning:: + This operator is deprecated. Please use :class:`~airflow.providers.google.cloud.operators.dataflow.DataflowCreatePipelineOperator`. To create a new Data Pipelines instance using a request body and parent name, use :class:`~airflow.providers.google.cloud.operators.datapipeline.CreateDataPipelineOperator`. The operator accesses Google Cloud's Data Pipelines API and calls upon the @@ -60,7 +61,8 @@ Here is an example of how you can create a Data Pipelines instance by running th Running a Data Pipeline ^^^^^^^^^^^^^^^^^^^^^^^ -This operator is deprecated. Please use :class:`~airflow.providers.google.cloud.operators.dataflow.DataflowRunPipelineOperator`. +.. warning:: + This operator is deprecated. Please use :class:`~airflow.providers.google.cloud.operators.dataflow.DataflowRunPipelineOperator`. To run a Data Pipelines instance, use :class:`~airflow.providers.google.cloud.operators.datapipeline.RunDataPipelineOperator`. The operator accesses Google Cloud's Data Pipelines API and calls upon the diff --git a/docs/apache-airflow-providers-google/operators/cloud/mlengine.rst b/docs/apache-airflow-providers-google/operators/cloud/mlengine.rst index 0848e1a28741a..350ae9dcf64b8 100644 --- a/docs/apache-airflow-providers-google/operators/cloud/mlengine.rst +++ b/docs/apache-airflow-providers-google/operators/cloud/mlengine.rst @@ -45,9 +45,10 @@ This creates a virtual machine that can run code specified in the trainer file, contains the main application code. A job can be initiated with the :class:`~airflow.providers.google.cloud.operators.mlengine.MLEngineStartTrainingJobOperator`. -This operator is deprecated. Please, use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.custom_job.CreateCustomPythonPackageTrainingJobOperator` -instead. +.. warning:: + This operator is deprecated. Please, use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.custom_job.CreateCustomPythonPackageTrainingJobOperator` + instead. .. exampleinclude:: /../../providers/tests/system/google/cloud/ml_engine/example_mlengine.py :language: python @@ -64,10 +65,11 @@ A model is a container that can hold multiple model versions. A new model can be The ``model`` field should be defined with a dictionary containing the information about the model. ``name`` is a required field in this dictionary. -This operator is deprecated. The model is created as a result of running Vertex AI operators that create training jobs -of any types. For example, you can use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.custom_job.CreateCustomPythonPackageTrainingJobOperator`. -The result of running this operator will be ready-to-use model saved in Model Registry. +.. warning:: + This operator is deprecated. The model is created as a result of running Vertex AI operators that create training jobs + of any types. For example, you can use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.custom_job.CreateCustomPythonPackageTrainingJobOperator`. + The result of running this operator will be ready-to-use model saved in Model Registry. .. exampleinclude:: /../../providers/tests/system/google/cloud/ml_engine/example_mlengine.py :language: python @@ -83,9 +85,10 @@ The :class:`~airflow.providers.google.cloud.operators.mlengine.MLEngineGetModelO can be used to obtain a model previously created. To obtain the correct model, ``model_name`` must be defined in the operator. -This operator is deprecated. Please, use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.model_service.GetModelOperator` -instead. +.. warning:: + This operator is deprecated. Please, use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.model_service.GetModelOperator` + instead. .. exampleinclude:: /../../providers/tests/system/google/cloud/ml_engine/example_mlengine.py :language: python @@ -114,11 +117,12 @@ The model must be specified by ``model_name``, and the ``version`` parameter sho all the information about the version. Within the ``version`` parameter's dictionary, the ``name`` field is required. -This operator is deprecated. Please, use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.custom_job.CreateCustomPythonPackageTrainingJobOperator` -instead. In this case, the new version of specific model could be created by specifying existing model id in -``parent_model`` parameter when running Training Job. This will ensure that new version of model will be trained except -of creating new model. +.. warning:: + This operator is deprecated. Please, use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.custom_job.CreateCustomPythonPackageTrainingJobOperator` + instead. In this case, the new version of specific model could be created by specifying existing model id in + ``parent_model`` parameter when running Training Job. This will ensure that new version of model will be trained except + of creating new model. .. exampleinclude:: /../../providers/tests/system/google/cloud/ml_engine/example_mlengine.py :language: python @@ -144,12 +148,13 @@ By default, the model code will run using the default model version. You can set :class:`~airflow.providers.google.cloud.operators.mlengine.MLEngineSetDefaultVersionOperator` by specifying the ``model_name`` and ``version_name`` parameters. -This operator is deprecated. Please, use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.model_service.SetDefaultVersionOnModelOperator` -instead. The desired model version to be set as default could be passed with the model ID in ``model_id`` parameter -in format ``projects/{project}/locations/{location}/models/{model_id}@{version_id}`` or -``projects/{project}/locations/{location}/models/{model_id}@{version_alias}``. By default, the first model version -created will be marked as default. +.. warning:: + This operator is deprecated. Please, use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.model_service.SetDefaultVersionOnModelOperator` + instead. The desired model version to be set as default could be passed with the model ID in ``model_id`` parameter + in format ``projects/{project}/locations/{location}/models/{model_id}@{version_id}`` or + ``projects/{project}/locations/{location}/models/{model_id}@{version_alias}``. By default, the first model version + created will be marked as default. .. exampleinclude:: /../../providers/tests/system/google/cloud/ml_engine/example_mlengine.py :language: python @@ -161,10 +166,11 @@ To list the model versions available, use the :class:`~airflow.providers.google.cloud.operators.mlengine.MLEngineListVersionsOperator` while specifying the ``model_name`` parameter. -This operator is deprecated. Please, use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.model_service.ListModelVersionsOperator` -instead. You can pass the name of the desired model in ``model_id`` parameter. If the model ID is passed -with version aliases, the operator will output all the versions available for this model. +.. warning:: + This operator is deprecated. Please, use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.model_service.ListModelVersionsOperator` + instead. You can pass the name of the desired model in ``model_id`` parameter. If the model ID is passed + with version aliases, the operator will output all the versions available for this model. .. exampleinclude:: /../../providers/tests/system/google/cloud/ml_engine/example_mlengine.py :language: python @@ -181,9 +187,10 @@ A Google Cloud AI Platform prediction job can be started with the For specifying the model origin, you need to provide either the ``model_name``, ``uri``, or ``model_name`` and ``version_name``. If you do not provide the ``version_name``, the operator will use the default model version. -This operator is deprecated. Please, use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job.CreateBatchPredictionJobOperator` -instead. +.. warning:: + This operator is deprecated. Please, use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job.CreateBatchPredictionJobOperator` + instead. .. exampleinclude:: /../../providers/tests/system/google/cloud/ml_engine/example_mlengine.py :language: python @@ -200,9 +207,10 @@ A model version can be deleted with the :class:`~airflow.providers.google.cloud.operators.mlengine.MLEngineDeleteVersionOperator` by the ``version_name`` and ``model_name`` parameters. -This operator is deprecated. Please, use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelVersionOperator` -instead. The default version could not be deleted on the model. +.. warning:: + This operator is deprecated. Please, use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelVersionOperator` + instead. The default version could not be deleted on the model. .. exampleinclude:: /../../providers/tests/system/google/cloud/ml_engine/example_mlengine.py :language: python @@ -214,9 +222,10 @@ You can also delete a model with the :class:`~airflow.providers.google.cloud.operators.mlengine.MLEngineDeleteModelOperator` by providing the ``model_name`` parameter. -This operator is deprecated. Please, use -:class:`~airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelOperator` -instead. +.. warning:: + This operator is deprecated. Please, use + :class:`~airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelOperator` + instead. .. exampleinclude:: /../../providers/tests/system/google/cloud/ml_engine/example_mlengine.py :language: python diff --git a/docs/apache-airflow/administration-and-deployment/production-deployment.rst b/docs/apache-airflow/administration-and-deployment/production-deployment.rst index f8dccbac781c1..7423bb844fa1f 100644 --- a/docs/apache-airflow/administration-and-deployment/production-deployment.rst +++ b/docs/apache-airflow/administration-and-deployment/production-deployment.rst @@ -47,7 +47,7 @@ Once that is done, you can run - ``migrate`` keeps track of migrations already applied, so it's safe to run as often as you need. -.. note:: +.. warning:: Prior to Airflow version 2.7.0, ``airflow db upgrade`` was used to apply migrations, however, it has been deprecated in favor of ``airflow db migrate``. diff --git a/docs/apache-airflow/installation/setting-up-the-database.rst b/docs/apache-airflow/installation/setting-up-the-database.rst index f72caca99bb11..75c7fba728662 100644 --- a/docs/apache-airflow/installation/setting-up-the-database.rst +++ b/docs/apache-airflow/installation/setting-up-the-database.rst @@ -26,7 +26,7 @@ Usually, you need to run ``airflow db migrate`` in order to create the database or migrate to the latest version if it does. You should make sure that Airflow components are not running while the database migration is being executed. -.. note:: +.. warning:: Prior to Airflow version 2.7.0, ``airflow db upgrade`` was used to apply migrations, however, it has been deprecated in favor of ``airflow db migrate``. diff --git a/docs/apache-airflow/installation/upgrading.rst b/docs/apache-airflow/installation/upgrading.rst index 8f33db6b193ca..675896d147770 100644 --- a/docs/apache-airflow/installation/upgrading.rst +++ b/docs/apache-airflow/installation/upgrading.rst @@ -81,7 +81,7 @@ Sample usage for Airflow version 2.7.0 or greater: ``airflow db migrate -s --from-version "2.4.3" -n "2.7.3"`` ``airflow db migrate --show-sql-only --from-version "2.4.3" --to-version "2.7.3"`` -.. note:: +.. warning:: ``airflow db upgrade`` has been replaced by ``airflow db migrate`` since Airflow version 2.7.0 and former has been deprecated. diff --git a/providers/src/airflow/providers/google/cloud/operators/automl.py b/providers/src/airflow/providers/google/cloud/operators/automl.py index ffc1371d73bf4..b49a1b6b67835 100644 --- a/providers/src/airflow/providers/google/cloud/operators/automl.py +++ b/providers/src/airflow/providers/google/cloud/operators/automl.py @@ -81,13 +81,14 @@ class AutoMLTrainModelOperator(GoogleCloudBaseOperator): """ Creates Google Cloud AutoML model. - AutoMLTrainModelOperator for tables, video intelligence, vision and natural language has been deprecated - and no longer available. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.auto_ml.CreateAutoMLTabularTrainingJobOperator`, - :class:`airflow.providers.google.cloud.operators.vertex_ai.auto_ml.CreateAutoMLVideoTrainingJobOperator`, - :class:`airflow.providers.google.cloud.operators.vertex_ai.auto_ml.CreateAutoMLImageTrainingJobOperator`, - :class:`airflow.providers.google.cloud.operators.vertex_ai.generative_model.SupervisedFineTuningTrainOperator`, - instead. + .. warning:: + AutoMLTrainModelOperator for tables, video intelligence, vision and natural language has been deprecated + and no longer available. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.auto_ml.CreateAutoMLTabularTrainingJobOperator`, + :class:`airflow.providers.google.cloud.operators.vertex_ai.auto_ml.CreateAutoMLVideoTrainingJobOperator`, + :class:`airflow.providers.google.cloud.operators.vertex_ai.auto_ml.CreateAutoMLImageTrainingJobOperator`, + :class:`airflow.providers.google.cloud.operators.vertex_ai.generative_model.SupervisedFineTuningTrainOperator`, + instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -198,8 +199,9 @@ class AutoMLPredictOperator(GoogleCloudBaseOperator): """ Runs prediction operation on Google Cloud AutoML. - AutoMLPredictOperator for text, image, and video prediction has been deprecated. - Please use endpoint_id param instead of model_id param. + .. warning:: + AutoMLPredictOperator for text, image, and video prediction has been deprecated. + Please use endpoint_id param instead of model_id param. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -356,13 +358,14 @@ class AutoMLBatchPredictOperator(GoogleCloudBaseOperator): """ Perform a batch prediction on Google Cloud AutoML. - AutoMLBatchPredictOperator for tables, video intelligence, vision and natural language has been deprecated - and no longer available. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job.CreateBatchPredictionJobOperator`, - :class:`airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job.GetBatchPredictionJobOperator`, - :class:`airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job.ListBatchPredictionJobsOperator`, - :class:`airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job.DeleteBatchPredictionJobOperator`, - instead. + .. warning:: + AutoMLBatchPredictOperator for tables, video intelligence, vision and natural language has been deprecated + and no longer available. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job.CreateBatchPredictionJobOperator`, + :class:`airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job.GetBatchPredictionJobOperator`, + :class:`airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job.ListBatchPredictionJobsOperator`, + :class:`airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job.DeleteBatchPredictionJobOperator`, + instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -597,9 +600,10 @@ class AutoMLImportDataOperator(GoogleCloudBaseOperator): """ Imports data to a Google Cloud AutoML dataset. - AutoMLImportDataOperator for tables, video intelligence, vision and natural language has been deprecated - and no longer available. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.dataset.ImportDataOperator` instead. + .. warning:: + AutoMLImportDataOperator for tables, video intelligence, vision and natural language has been deprecated + and no longer available. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.dataset.ImportDataOperator` instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -704,9 +708,10 @@ class AutoMLTablesListColumnSpecsOperator(GoogleCloudBaseOperator): """ Lists column specs in a table. - Operator AutoMLTablesListColumnSpecsOperator has been deprecated due to shutdown of - a legacy version of AutoML Tables on March 31, 2024. For additional information - see: https://cloud.google.com/automl-tables/docs/deprecations. + .. warning:: + Operator AutoMLTablesListColumnSpecsOperator has been deprecated due to shutdown of + a legacy version of AutoML Tables on March 31, 2024. For additional information + see: https://cloud.google.com/automl-tables/docs/deprecations. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -823,11 +828,12 @@ class AutoMLTablesUpdateDatasetOperator(GoogleCloudBaseOperator): """ Updates a dataset. - Operator AutoMLTablesUpdateDatasetOperator has been deprecated due to shutdown of - a legacy version of AutoML Tables on March 31, 2024. For additional information - see: https://cloud.google.com/automl-tables/docs/deprecations. - Please use :class:`airflow.providers.google.cloud.operators.vertex_ai.dataset.UpdateDatasetOperator` - instead. + .. warning:: + Operator AutoMLTablesUpdateDatasetOperator has been deprecated due to shutdown of + a legacy version of AutoML Tables on March 31, 2024. For additional information + see: https://cloud.google.com/automl-tables/docs/deprecations. + Please use :class:`airflow.providers.google.cloud.operators.vertex_ai.dataset.UpdateDatasetOperator` + instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -922,9 +928,10 @@ class AutoMLGetModelOperator(GoogleCloudBaseOperator): """ Get Google Cloud AutoML model. - AutoMLGetModelOperator for tables, video intelligence, vision and natural language has been deprecated - and no longer available. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.GetModelOperator` instead. + .. warning:: + AutoMLGetModelOperator for tables, video intelligence, vision and natural language has been deprecated + and no longer available. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.GetModelOperator` instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -1015,9 +1022,10 @@ class AutoMLDeleteModelOperator(GoogleCloudBaseOperator): """ Delete Google Cloud AutoML model. - AutoMLDeleteModelOperator for tables, video intelligence, vision and natural language has been deprecated - and no longer available. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelOperator` instead. + .. warning:: + AutoMLDeleteModelOperator for tables, video intelligence, vision and natural language has been deprecated + and no longer available. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelOperator` instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -1112,11 +1120,12 @@ class AutoMLDeployModelOperator(GoogleCloudBaseOperator): Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically. - Operator AutoMLDeployModelOperator has been deprecated due to shutdown of a legacy version - of AutoML Natural Language, Vision, Video Intelligence on March 31, 2024. - For additional information see: https://cloud.google.com/vision/automl/docs/deprecations . - Please use :class:`airflow.providers.google.cloud.operators.vertex_ai.endpoint_service.DeployModelOperator` - instead. + .. warning:: + Operator AutoMLDeployModelOperator has been deprecated due to shutdown of a legacy version + of AutoML Natural Language, Vision, Video Intelligence on March 31, 2024. + For additional information see: https://cloud.google.com/vision/automl/docs/deprecations . + Please use :class:`airflow.providers.google.cloud.operators.vertex_ai.endpoint_service.DeployModelOperator` + instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -1209,9 +1218,10 @@ class AutoMLTablesListTableSpecsOperator(GoogleCloudBaseOperator): """ Lists table specs in a dataset. - Operator AutoMLTablesListTableSpecsOperator has been deprecated due to shutdown of - a legacy version of AutoML Tables on March 31, 2024. For additional information - see: https://cloud.google.com/automl-tables/docs/deprecations. + .. warning:: + Operator AutoMLTablesListTableSpecsOperator has been deprecated due to shutdown of + a legacy version of AutoML Tables on March 31, 2024. For additional information + see: https://cloud.google.com/automl-tables/docs/deprecations. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -1318,9 +1328,10 @@ class AutoMLListDatasetOperator(GoogleCloudBaseOperator): """ Lists AutoML Datasets in project. - AutoMLListDatasetOperator for tables, video intelligence, vision and natural language has been deprecated - and no longer available. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.dataset.ListDatasetsOperator` instead. + .. warning:: + AutoMLListDatasetOperator for tables, video intelligence, vision and natural language has been deprecated + and no longer available. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.dataset.ListDatasetsOperator` instead. .. seealso:: For more information on how to use this operator, take a look at the guide: diff --git a/providers/src/airflow/providers/google/cloud/operators/mlengine.py b/providers/src/airflow/providers/google/cloud/operators/mlengine.py index f6e43f71ab400..630c8b78ce2d6 100644 --- a/providers/src/airflow/providers/google/cloud/operators/mlengine.py +++ b/providers/src/airflow/providers/google/cloud/operators/mlengine.py @@ -90,9 +90,10 @@ class MLEngineStartBatchPredictionJobOperator(GoogleCloudBaseOperator): """ Start a Google Cloud ML Engine prediction job. - This operator is deprecated. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.batch_prediction.CreateBatchPredictionJobOperator` - instead. + .. warning:: + This operator is deprecated. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.batch_prediction.CreateBatchPredictionJobOperator` + instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -305,8 +306,8 @@ class MLEngineManageModelOperator(GoogleCloudBaseOperator): Operator for managing a Google Cloud ML Engine model. .. warning:: - This operator is deprecated. Consider using operators for specific operations: - MLEngineCreateModelOperator, MLEngineGetModelOperator. + This operator is deprecated. Consider using operators for specific operations: + MLEngineCreateModelOperator, MLEngineGetModelOperator. :param model: A dictionary containing the information about the model. If the `operation` is `create`, then the `model` parameter should @@ -378,8 +379,9 @@ class MLEngineCreateModelOperator(GoogleCloudBaseOperator): """ Creates a new model. - This operator is deprecated. Please use appropriate VertexAI operator from - :class:`airflow.providers.google.cloud.operators.vertex_ai` instead. + .. warning:: + This operator is deprecated. Please use appropriate VertexAI operator from + :class:`airflow.providers.google.cloud.operators.vertex_ai` instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -452,8 +454,9 @@ class MLEngineGetModelOperator(GoogleCloudBaseOperator): """ Gets a particular model. - This operator is deprecated. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.GetModelOperator` instead. + .. warning:: + This operator is deprecated. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.GetModelOperator` instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -525,9 +528,9 @@ class MLEngineDeleteModelOperator(GoogleCloudBaseOperator): """ Deletes a model. - This operator is deprecated. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelOperator` instead. - + .. warning:: + This operator is deprecated. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelOperator` instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -607,9 +610,9 @@ class MLEngineManageVersionOperator(GoogleCloudBaseOperator): Operator for managing a Google Cloud ML Engine version. .. warning:: - This operator is deprecated. Consider using operators for specific operations: - MLEngineCreateVersionOperator, MLEngineSetDefaultVersionOperator, - MLEngineListVersionsOperator, MLEngineDeleteVersionOperator. + This operator is deprecated. Consider using operators for specific operations: + MLEngineCreateVersionOperator, MLEngineSetDefaultVersionOperator, + MLEngineListVersionsOperator, MLEngineDeleteVersionOperator. :param model_name: The name of the Google Cloud ML Engine model that the version belongs to. (templated) @@ -723,7 +726,9 @@ class MLEngineCreateVersionOperator(GoogleCloudBaseOperator): """ Creates a new version in the model. - This operator is deprecated. Please use parent_model parameter of VertexAI operators instead. + .. warning:: + This operator is deprecated. Please use parent_model parameter of VertexAI + operators instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -812,9 +817,10 @@ class MLEngineSetDefaultVersionOperator(GoogleCloudBaseOperator): """ Sets a version in the model. - This operator is deprecated. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.SetDefaultVersionOnModelOperator` - instead. + .. warning:: + This operator is deprecated. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.SetDefaultVersionOnModelOperator` + instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -903,9 +909,10 @@ class MLEngineListVersionsOperator(GoogleCloudBaseOperator): """ Lists all available versions of the model. - This operator is deprecated. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.ListModelVersionsOperator` - instead. + .. warning:: + This operator is deprecated. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.ListModelVersionsOperator` + instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -987,9 +994,10 @@ class MLEngineDeleteVersionOperator(GoogleCloudBaseOperator): """ Deletes the version from the model. - This operator is deprecated. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelVersionOperator` - instead. + .. warning:: + This operator is deprecated. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelVersionOperator` + instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -1077,9 +1085,10 @@ class MLEngineStartTrainingJobOperator(GoogleCloudBaseOperator): """ Operator for launching a MLEngine training job. - This operator is deprecated. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.custom_job.CreateCustomPythonPackageTrainingJobOperator` - instead. + .. warning:: + This operator is deprecated. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.custom_job.CreateCustomPythonPackageTrainingJobOperator` + instead. .. seealso:: For more information on how to use this operator, take a look at the guide: @@ -1414,9 +1423,10 @@ class MLEngineTrainingCancelJobOperator(GoogleCloudBaseOperator): """ Operator for cleaning up failed MLEngine training job. - This operator is deprecated. Please use - :class:`airflow.providers.google.cloud.operators.vertex_ai.custom_job.CancelCustomTrainingJobOperator` - instead. + .. warning:: + This operator is deprecated. Please use + :class:`airflow.providers.google.cloud.operators.vertex_ai.custom_job.CancelCustomTrainingJobOperator` + instead. :param job_id: A unique templated id for the submitted Google MLEngine training job. (templated) diff --git a/providers/src/airflow/providers/google/cloud/transfers/bigquery_to_mssql.py b/providers/src/airflow/providers/google/cloud/transfers/bigquery_to_mssql.py index e10badd8b508b..56b58523eac2b 100644 --- a/providers/src/airflow/providers/google/cloud/transfers/bigquery_to_mssql.py +++ b/providers/src/airflow/providers/google/cloud/transfers/bigquery_to_mssql.py @@ -45,6 +45,9 @@ class BigQueryToMsSqlOperator(BigQueryToSqlBaseOperator): :param mssql_table: target MsSQL table. It is deprecated: use target_table_name instead. (templated) :param target_table_name: target MsSQL table. It takes precedence over mssql_table. (templated) :param mssql_conn_id: reference to a specific mssql hook + + .. warning:: + The `mssql_table` parameter has been deprecated. Use `target_table_name` instead. """ template_fields: Sequence[str] = ( diff --git a/providers/src/airflow/providers/google/cloud/transfers/bigquery_to_mysql.py b/providers/src/airflow/providers/google/cloud/transfers/bigquery_to_mysql.py index 22c35d0a243f6..33b1d6f7ddbd2 100644 --- a/providers/src/airflow/providers/google/cloud/transfers/bigquery_to_mysql.py +++ b/providers/src/airflow/providers/google/cloud/transfers/bigquery_to_mysql.py @@ -39,6 +39,9 @@ class BigQueryToMySqlOperator(BigQueryToSqlBaseOperator): specific database. It is deprecated: use target_table_name instead. (templated) :param target_table_name: target MySQL table. It takes precedence over mysql_table. (templated) :param mysql_conn_id: Reference to :ref:`mysql connection id `. + + .. warning:: + The `mysql_table` parameter has been deprecated. Use `target_table_name` instead. """ template_fields: Sequence[str] = (*BigQueryToSqlBaseOperator.template_fields, "dataset_id", "table_id")