Skip to content

Commit

Permalink
Introduce gcp advance API (V3) translate native datasets operators
Browse files Browse the repository at this point in the history
- Add support for native datasets for Cloud Translation API.

- The datasets created via automl API are considered legacy,
as they keep been supported, all new enhancements
will be avaliable for native datasets(reccomended), created by Cloud Translate
API, see more: https://cloud.google.com/translate/docs/advanced/automl-upgrade.
  • Loading branch information
Oleg Kachur committed Nov 22, 2024
1 parent 22d1406 commit 0997e07
Show file tree
Hide file tree
Showing 8 changed files with 1,075 additions and 11 deletions.
85 changes: 85 additions & 0 deletions docs/apache-airflow-providers-google/operators/cloud/translate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,96 @@ For parameter definition, take a look at
:class:`~airflow.providers.google.cloud.operators.translate.TranslateTextBatchOperator`


.. _howto/operator:TranslateCreateDatasetOperator:

TranslateCreateDatasetOperator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Create a native translation dataset using Cloud Translate API (Advanced V3).

For parameter definition, take a look at
:class:`~airflow.providers.google.cloud.operators.translate.TranslateCreateDatasetOperator`

Using the operator
""""""""""""""""""

Basic usage of the operator:

.. exampleinclude:: /../../providers/tests/system/google/cloud/translate/example_translate_dataset.py
:language: python
:dedent: 4
:start-after: [START howto_operator_translate_automl_create_dataset]
:end-before: [END howto_operator_translate_automl_create_dataset]


.. _howto/operator:TranslateImportDataOperator:

TranslateImportDataOperator
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Import data to the existing native dataset, using Cloud Translate API (Advanced V3).

For parameter definition, take a look at
:class:`~airflow.providers.google.cloud.operators.translate.TranslateImportDataOperator`

Using the operator
""""""""""""""""""

Basic usage of the operator:

.. exampleinclude:: /../../providers/tests/system/google/cloud/translate/example_translate_dataset.py
:language: python
:dedent: 4
:start-after: [START howto_operator_translate_automl_import_data]
:end-before: [END howto_operator_translate_automl_import_data]


.. _howto/operator:TranslateDatasetsListOperator:

TranslateDatasetsListOperator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Get list of translation datasets using Cloud Translate API (Advanced V3).

For parameter definition, take a look at
:class:`~airflow.providers.google.cloud.operators.translate.TranslateDatasetsListOperator`

Using the operator
""""""""""""""""""

Basic usage of the operator:

.. exampleinclude:: /../../providers/tests/system/google/cloud/translate/example_translate_dataset.py
:language: python
:dedent: 4
:start-after: [START howto_operator_translate_automl_list_datasets]
:end-before: [END howto_operator_translate_automl_list_datasets]


.. _howto/operator:TranslateDeleteDatasetOperator:

TranslateDeleteDatasetOperator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Delete a native translation dataset using Cloud Translate API (Advanced V3).

For parameter definition, take a look at
:class:`~airflow.providers.google.cloud.operators.translate.TranslateDeleteDatasetOperator`

Using the operator
""""""""""""""""""

Basic usage of the operator:

.. exampleinclude:: /../../providers/tests/system/google/cloud/translate/example_translate_dataset.py
:language: python
:dedent: 4
:start-after: [START howto_operator_translate_automl_delete_dataset]
:end-before: [END howto_operator_translate_automl_delete_dataset]


More information
""""""""""""""""""
See:
Base (V2) `Google Cloud Translate documentation <https://cloud.google.com/translate/docs/translating-text>`_.
Advanced (V3) `Google Cloud Translate (Advanced) documentation <https://cloud.google.com/translate/docs/advanced/translating-text-v3>`_.
Datasets `Legacy and native dataset comparison <https://cloud.google.com/translate/docs/advanced/automl-upgrade>`_.


Reference
Expand Down
1 change: 1 addition & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,7 @@ LineItem
lineterminator
linter
linux
ListDatasetsPager
ListGenerator
ListInfoTypesResponse
ListSecretsPager
Expand Down
Loading

0 comments on commit 0997e07

Please sign in to comment.