airflow.providers.apache.tinkerpop.hooks.gremlin¶
This module allows connecting to an Graph DB using the Gremlin Client.
Attributes¶
Classes¶
Interact with Graph DB using the Gremlin Client. |
Module Contents¶
- class airflow.providers.apache.tinkerpop.hooks.gremlin.GremlinHook(conn_id=default_conn_name, *args, **kwargs)[source]¶
Bases:
airflow.hooks.base.BaseHook
Interact with Graph DB using the Gremlin Client.
This hook creates a connection to Graph DB and allows you to run Gremlin queries.`
- Parameters:
gremlin_conn_id – Reference to the connection ID configured in Airflow.
- get_conn(serializer=None)[source]¶
Establish a connection to Graph DB with the Gremlin Client.
- Parameters:
serializer – Message serializer to use for the client.
- Returns:
An instance of the Gremlin Client.
- Return type:
gremlin_python.driver.client.Client
- get_uri(conn)[source]¶
Build the URI from the connection object and extra parameters.
- Parameters:
conn (airflow.models.Connection) – Airflow Connection object.
- Returns:
URI string.
- Return type:
- get_client(conn, traversal_source, uri, message_serializer=None)[source]¶
Create and return a new Gremlin client.
- Parameters:
- Returns:
An instance of the Gremlin Client.
- Return type:
gremlin_python.driver.client.Client