josh-fell commented on code in PR #25529: URL: https://github.com/apache/airflow/pull/25529#discussion_r937862132
########## tests/system/providers/arangodb/example_arangodb.py: ########## @@ -0,0 +1,80 @@ +# 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. +from datetime import datetime + +from airflow.models.dag import DAG +from airflow.providers.arangodb.operators.arangodb import AQLOperator +from airflow.providers.arangodb.sensors.arangodb import AQLSensor +from tests.system.utils import get_test_env_id + +ENV_ID = get_test_env_id() +DAG_ID = "example_arangodb_operator" + +with DAG( + DAG_ID, + start_date=datetime(2021, 1, 1), + tags=['example'], Review Comment: ```suggestion schedule_interval='@once', tags=['example'], ``` Looks like [this parameter is explicitly needed](https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-47+New+design+of+Airflow+System+Tests#:~:text=Make%20sure%20to%20include%20these%20parameters%20into%20DAG%20call%3A) based on the AIP docs. ########## docs/apache-airflow-providers-arangodb/operators/index.rst: ########## @@ -53,14 +53,14 @@ AQL query in `ArangoDB <https://www.arangodb.com/>`__. An example for waiting a document in **students** collection with student name **judy** can be implemented as following: -.. exampleinclude:: /../../airflow/providers/arangodb/example_dags/example_arangodb.py +.. exampleinclude:: /../../tests/system/providers/arangodb/example_arangodb.py :language: python :start-after: [START howto_aql_sensor_arangodb] Review Comment: ```suggestion :dedent: 4 :start-after: [START howto_aql_sensor_arangodb] ``` ########## docs/apache-airflow-providers-arangodb/operators/index.rst: ########## @@ -32,15 +32,15 @@ further process the result using **result_processor** Callable as you like. An example of Listing all Documents in **students** collection can be implemented as following: -.. exampleinclude:: /../../airflow/providers/arangodb/example_dags/example_arangodb.py +.. exampleinclude:: /../../tests/system/providers/arangodb/example_arangodb.py :language: python :start-after: [START howto_aql_operator_arangodb] Review Comment: ```suggestion :dedent: 4 :start-after: [START howto_aql_operator_arangodb] ``` ########## docs/apache-airflow-providers-arangodb/operators/index.rst: ########## @@ -53,14 +53,14 @@ AQL query in `ArangoDB <https://www.arangodb.com/>`__. An example for waiting a document in **students** collection with student name **judy** can be implemented as following: -.. exampleinclude:: /../../airflow/providers/arangodb/example_dags/example_arangodb.py +.. exampleinclude:: /../../tests/system/providers/arangodb/example_arangodb.py :language: python :start-after: [START howto_aql_sensor_arangodb] :end-before: [END howto_aql_sensor_arangodb] Similar to **AQLOperator**, You can also provide file template to load query - -.. exampleinclude:: /../../airflow/providers/arangodb/example_dags/example_arangodb.py +.. exampleinclude:: /../../tests/system/providers/arangodb/example_arangodb.py :language: python :start-after: [START howto_aql_sensor_template_file_arangodb] Review Comment: ```suggestion :dedent: 4 :start-after: [START howto_aql_sensor_template_file_arangodb] ``` ########## docs/apache-airflow-providers-arangodb/operators/index.rst: ########## @@ -32,15 +32,15 @@ further process the result using **result_processor** Callable as you like. An example of Listing all Documents in **students** collection can be implemented as following: -.. exampleinclude:: /../../airflow/providers/arangodb/example_dags/example_arangodb.py +.. exampleinclude:: /../../tests/system/providers/arangodb/example_arangodb.py :language: python :start-after: [START howto_aql_operator_arangodb] :end-before: [END howto_aql_operator_arangodb] You can also provide file template (.sql) to load query, remember path is relative to **dags/** folder, if you want to provide any other path please provide **template_searchpath** while creating **DAG** object, -.. exampleinclude:: /../../airflow/providers/arangodb/example_dags/example_arangodb.py +.. exampleinclude:: /../../tests/system/providers/arangodb/example_arangodb.py :language: python :start-after: [START howto_aql_operator_template_file_arangodb] Review Comment: ```suggestion :dedent: 4 :start-after: [START howto_aql_operator_template_file_arangodb] ``` Now that the `START/END` markers have been indented in the system test example DAG, this option should be added to the `exampleinclude::` directives in the docs so the code snippets are rendered properly. -- 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]
