Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Datastore system tests to new design (AIP-47) #23108

Merged
merged 1 commit into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 0 additions & 185 deletions airflow/providers/google/cloud/example_dags/example_datastore.py

This file was deleted.

26 changes: 13 additions & 13 deletions docs/apache-airflow-providers-google/operators/cloud/datastore.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Export Entities
To export entities from Google Cloud Datastore to Cloud Storage use
:class:`~airflow.providers.google.cloud.operators.datastore.CloudDatastoreExportEntitiesOperator`

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_export_import.py
:language: python
:dedent: 4
:start-after: [START how_to_export_task]
Expand All @@ -52,7 +52,7 @@ Import Entities
To import entities from Cloud Storage to Google Cloud Datastore use
:class:`~airflow.providers.google.cloud.operators.datastore.CloudDatastoreImportEntitiesOperator`

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_export_import.py
:language: python
:dedent: 4
:start-after: [START how_to_import_task]
Expand All @@ -66,15 +66,15 @@ Allocate Ids
To allocate IDs for incomplete keys use
:class:`~airflow.providers.google.cloud.operators.datastore.CloudDatastoreAllocateIdsOperator`

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_commit.py
:language: python
:dedent: 4
:start-after: [START how_to_allocate_ids]
:end-before: [END how_to_allocate_ids]

An example of a partial keys required by the operator:

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_commit.py
:language: python
:dedent: 0
:start-after: [START how_to_keys_def]
Expand All @@ -88,15 +88,15 @@ Begin transaction
To begin a new transaction use
:class:`~airflow.providers.google.cloud.operators.datastore.CloudDatastoreBeginTransactionOperator`

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_commit.py
:language: python
:dedent: 4
:start-after: [START how_to_begin_transaction]
:end-before: [END how_to_begin_transaction]

An example of a transaction options required by the operator:

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_commit.py
:language: python
:dedent: 0
:start-after: [START how_to_transaction_def]
Expand All @@ -110,15 +110,15 @@ Commit transaction
To commit a transaction, optionally creating, deleting or modifying some entities
use :class:`~airflow.providers.google.cloud.operators.datastore.CloudDatastoreCommitOperator`

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_commit.py
:language: python
:dedent: 4
:start-after: [START how_to_commit_task]
:end-before: [END how_to_commit_task]

An example of a commit information required by the operator:

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_commit.py
:language: python
:dedent: 0
:start-after: [START how_to_commit_def]
Expand All @@ -132,15 +132,15 @@ Run query
To run a query for entities use
:class:`~airflow.providers.google.cloud.operators.datastore.CloudDatastoreRunQueryOperator`

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_query.py
:language: python
:dedent: 4
:start-after: [START how_to_run_query]
:end-before: [END how_to_run_query]

An example of a query required by the operator:

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_query.py
:language: python
:dedent: 0
:start-after: [START how_to_query_def]
Expand All @@ -154,7 +154,7 @@ Roll back transaction
To roll back a transaction
use :class:`~airflow.providers.google.cloud.operators.datastore.CloudDatastoreRollbackOperator`

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_rollback.py
:language: python
:dedent: 4
:start-after: [START how_to_rollback_transaction]
Expand All @@ -168,7 +168,7 @@ Get operation state
To get the current state of a long-running operation use
:class:`~airflow.providers.google.cloud.operators.datastore.CloudDatastoreGetOperationOperator`

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_export_import.py
:language: python
:dedent: 4
:start-after: [START get_operation_state]
Expand All @@ -182,7 +182,7 @@ Delete operation
To delete an operation use
:class:`~airflow.providers.google.cloud.operators.datastore.CloudDatastoreDeleteOperationOperator`

.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_datastore.py
.. exampleinclude:: /../../tests/system/providers/google/datastore/example_datastore_export_import.py
:language: python
:dedent: 4
:start-after: [START delete_operation]
Expand Down
Loading