ahmadtfarhan opened a new pull request, #46977:
URL: https://github.com/apache/airflow/pull/46977
<!--
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.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
New Provider for Gremlin (Apache TinkerPop)
---
## Summary
This PR introduces a new provider for Gremlin—the graph traversal language
of [Apache TinkerPop](https://tinkerpop.apache.org/gremlin.html). The provider
is designed to facilitate connections to graph databases supporting Gremlin,
such as Azure Cosmos DB and Amazon Neptune.
## Background
Previously, I had developed a custom hook to query data from Azure Cosmos DB
using Apache Gremlin. In this PR, I’ve consolidated that functionality into a
full provider. While I managed to run it locally on the main branch, I
encountered the BaseHook issue
([#45233](https://github.com/apache/airflow/issues/45233)), so I performed all
testing on the v2-10-test branch.
## Changes
### Provider Implementation:
- The new GremlinHook establishes a connection using the Gremlin Python
Client.
- It constructs the connection URI based on the Airflow Connection’s
properties and extra parameters.
- The hook exposes a `run(query: str)` method that submits raw Gremlin query
strings and returns the results.
### Operator:
- The GremlinOperator instantiates the GremlinHook with a given connection
ID and query, then calls `run(query)` to execute the query.
### Testing:
- Unit tests have been added to validate the URI construction, client
instantiation, and query execution.
- Manual tests confirmed that raw queries using `Client.submit()`
successfully return results from Cosmos DB using Gremlin.
## Testing & Validation
- I ran unit tests on the v2-10-test branch after encountering BaseHook
issues on the main branch.
- The provider has been validated locally by submitting queries such as
g.V() and verifying that the expected results are returned from Azure Cosmos DB.
--
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]