You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/29 13:36:10 UTC

[GitHub] [airflow] pateash commented on a change in pull request #22548: WIP: Add Arango hook

pateash commented on a change in pull request #22548:
URL: https://github.com/apache/airflow/pull/22548#discussion_r837484314



##########
File path: airflow/providers/arangodb/operators/arangodb.py
##########
@@ -0,0 +1,61 @@
+#
+# 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 typing import TYPE_CHECKING, Optional, Sequence, Callable
+
+from airflow.models import BaseOperator
+from airflow.providers.arangodb.hooks.arangodb import ArangoDBHook
+
+if TYPE_CHECKING:
+    from airflow.utils.context import Context
+
+
+class AQLOperator(BaseOperator):
+    """
+    Executes AQL query in a ArangoDB database
+
+    .. seealso::
+        For more information on how to use this operator, take a look at the guide:
+        :ref:`howto/operator:AQLOperator`
+
+    :param sql: the AQL query to be executed. Can receive a str representing a
+        sql statement
+    :param result_processor: function to further process the Result from ArangoDB
+    :param arangodb_conn_id: Reference to :ref:`ArangoDB connection id <howto/connection:arangodb>`.
+    """
+
+    template_fields: Sequence[str] = ('sql',)

Review comment:
       yeah, make sense 
   added

##########
File path: airflow/providers/arangodb/sensors/arangodb.py
##########
@@ -0,0 +1,55 @@
+#
+# 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 typing import TYPE_CHECKING, Sequence
+
+from airflow.providers.arangodb.hooks.arangodb import ArangoDBHook
+from airflow.sensors.base import BaseSensorOperator
+
+if TYPE_CHECKING:
+    from airflow.utils.context import Context
+
+
+class AQLSensor(BaseSensorOperator):
+    """
+    Checks for the existence of a document which
+    matches the given query in ArangoDB. Example:
+
+    :param collection: Target DB collection.
+    :param query: The query to find the target document.
+    :param arangodb_conn_id: The :ref:`ArangoDB connection id <howto/connection:arangodb>` to use
+        when connecting to ArangoDB.
+    :param arangodb_db: Target ArangoDB name.
+    """
+
+    template_fields: Sequence[str] = ('sql',)

Review comment:
       I am not sure, we really want to 
   added




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org