o-nikolas commented on code in PR #30204: URL: https://github.com/apache/airflow/pull/30204#discussion_r1146955111
########## tests/system/providers/databricks/example_databricks_sensor.py: ########## @@ -0,0 +1,71 @@ +# +# 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. +""" +This is an example DAG which uses the DatabricksSqlSensor. +The task checks for a generic SQL statement against a Delta table, +and if a result is returned, the task succeeds, else it times out. +""" +from __future__ import annotations + +import os +from datetime import datetime + +from airflow import DAG +from airflow.providers.databricks.sensors.sql import DatabricksSqlSensor + +# [docs] +ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID") +# [docs] +DAG_ID = "example_databricks_sensor" + +with DAG( + dag_id=DAG_ID, + schedule="@daily", + start_date=datetime(2021, 1, 1), + tags=["example"], + catchup=False, +) as dag: + # [docs] + connection_id = "databricks_default" + sql_endpoint_name = "Starter Warehouse" + + # [START howto_sensor_databricks_sql] Review Comment: Hey @harishkrao, Sorry, I should have been more explicit! Those tags are meant to be used in doc readmes for each operator. You can see an example here: https://github.com/apache/airflow/blob/main/docs/apache-airflow-providers-amazon/operators/sqs.rst#sensors There already exists a doc readme for Databricks sql Operator ([link](https://github.com/apache/airflow/blob/main/docs/apache-airflow-providers-databricks/operators/sql.rst)), you can just update that doc to include a section for the Sensor. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
