This is an automated email from the ASF dual-hosted git repository.
husseinawala 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 fea8c9024f Delete azure cosmos DB sensor example_dag (#32906)
fea8c9024f is described below
commit fea8c9024f3930aeba6bcf95d346fefd3ca8a016
Author: Amogh Desai <[email protected]>
AuthorDate: Wed Aug 2 23:09:50 2023 +0530
Delete azure cosmos DB sensor example_dag (#32906)
* Migrating azure cosmos DB sensor example test to systest
* fixing docs
* fixing docs
* renaming the file
---
.../example_dag/example_cosmos_document_sensor.py | 53 ----------------------
...ument_sesnor.rst => cosmos_document_sensor.rst} | 2 +-
.../microsoft/azure/example_azure_cosmosdb.py | 3 +-
3 files changed, 3 insertions(+), 55 deletions(-)
diff --git
a/airflow/providers/microsoft/azure/example_dag/example_cosmos_document_sensor.py
b/airflow/providers/microsoft/azure/example_dag/example_cosmos_document_sensor.py
deleted file mode 100644
index 198420147e..0000000000
---
a/airflow/providers/microsoft/azure/example_dag/example_cosmos_document_sensor.py
+++ /dev/null
@@ -1,53 +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.
-"""
-Example Airflow DAG that senses document in Azure Cosmos DB.
-
-This DAG relies on the following OS environment variables
-
-* DATABASE_NAME - Target CosmosDB database_name.
-* COLLECTION_NAME - Target CosmosDB collection_name.
-* DOCUMENT_ID - The ID of the target document.
-"""
-from __future__ import annotations
-
-import os
-from datetime import datetime
-
-from airflow.models import DAG
-from airflow.providers.microsoft.azure.sensors.cosmos import
AzureCosmosDocumentSensor
-
-DATABASE_NAME = os.environ.get("DATABASE_NAME", "example-database-name")
-COLLECTION_NAME = os.environ.get("COLLECTION_NAME", "example-collection-name")
-DOCUMENT_ID = os.environ.get("DOCUMENT_ID", "example-document-id")
-
-
-with DAG(
- "example_cosmos_document_sensor",
- start_date=datetime(2022, 8, 8),
- catchup=False,
- tags=["example"],
-) as dag:
- # [START cosmos_document_sensor]
- azure_wasb_sensor = AzureCosmosDocumentSensor(
- database_name=DATABASE_NAME,
- collection_name=COLLECTION_NAME,
- document_id=DOCUMENT_ID,
- task_id="cosmos_document_sensor",
- )
- # [END cosmos_document_sensor]
diff --git
a/docs/apache-airflow-providers-microsoft-azure/sensors/cosmos_document_sesnor.rst
b/docs/apache-airflow-providers-microsoft-azure/sensors/cosmos_document_sensor.rst
similarity index 93%
rename from
docs/apache-airflow-providers-microsoft-azure/sensors/cosmos_document_sesnor.rst
rename to
docs/apache-airflow-providers-microsoft-azure/sensors/cosmos_document_sensor.rst
index d4b5631204..c0a7d140cc 100644
---
a/docs/apache-airflow-providers-microsoft-azure/sensors/cosmos_document_sesnor.rst
+++
b/docs/apache-airflow-providers-microsoft-azure/sensors/cosmos_document_sensor.rst
@@ -28,7 +28,7 @@ Azure Cosmos Document Sensor
Checks for the existence of a document which matches the given query in
CosmosDB.
:class:`~airflow.providers.microsoft.azure.sensors.cosmos.AzureCosmosDocumentSensor`
-.. exampleinclude::
/../../airflow/providers/microsoft/azure/example_dag/example_cosmos_document_sensor.py
+.. exampleinclude::
/../../tests/system/providers/microsoft/azure/example_azure_cosmosdb.py
:language: python
:dedent: 4
:start-after: [START cosmos_document_sensor]
diff --git a/tests/system/providers/microsoft/azure/example_azure_cosmosdb.py
b/tests/system/providers/microsoft/azure/example_azure_cosmosdb.py
index 0e741ea165..6d089c22b5 100644
--- a/tests/system/providers/microsoft/azure/example_azure_cosmosdb.py
+++ b/tests/system/providers/microsoft/azure/example_azure_cosmosdb.py
@@ -48,12 +48,13 @@ with DAG(
doc_md=__doc__,
tags=["example"],
) as dag:
-
+ # [START cosmos_document_sensor]
t1 = AzureCosmosDocumentSensor(
task_id="check_cosmos_file",
collection_name="airflow_example_coll",
document_id="airflow_checkid",
)
+ # [END cosmos_document_sensor]
t2 = AzureCosmosInsertDocumentOperator(
task_id="insert_cosmos_file",