Apache Airflow Hex provider containing Hooks and Operators
Project description
Hex Airflow Provider
Provides an Airflow Operator and Hook to trigger Hex project runs.
This Airflow Provider Package provides Hooks and Operators for interacting with the Hex API.
Requirements
- Airflow >=2.2
- Hex API Token
Initial Setup
Install the package.
pip install airflow-provider-hex
After creating a Hex API token, set up your Airflow Connection Credentials in the Airflow UI.
- Connection ID:
hex_default
- Connection Type:
Hex Connection
- Host:
https://app.hex.tech
- Hex API Token:
your-token-here
Operators
The airflow_provider_hex.operators.hex.HexRunProjectOperator
Operator runs Hex Projects, either synchronously or asynchronously.
In the synchronous mode, the Operator will start a Hex Project run and then poll the run until either an error or success status is returned, or until the poll timeout. If the timeout occurs, the default behaviour is to attempt to cancel the run.
In the asynchronous mode, the Operator will request that a Hex Project is run, but will not poll for completion. This can be useful for long-running projects.
The operator accepts inputs in the form of a dictionary. These can be used to override existing input elements in your Hex project.
Hooks
The airflow_provider_hex.hooks.hex.HexHook
provides a low-level interface to the Hex API.
These can be useful for testing and development, as they provide both a generic
run
method which sends an authenticated request to the Hex API, as well as
implementations of the run
method that provide access to specific endpoints.
Examples
A simplified example DAG demonstrates how to use the Airflow Operator
from airflow_provider_hex.operators.hex import HexRunProjectOperator
PROJ_ID = 'abcdef-ghijkl-mnopq'
...
sync_run = HexRunProjectOperator(
task_id="run",
hex_conn_id="hex_default",
project_id=PROJ_ID,
dag=dag,
input_parameters={'myParam': 42}
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file airflow-provider-hex-0.1.7.tar.gz
.
File metadata
- Download URL: airflow-provider-hex-0.1.7.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b488cd8422b27bfd571f91ab3821e63bdeed3303d1a3def7eceda09d573e1aee |
|
MD5 | 6b5d33e497bca2a9e96110fdd478d711 |
|
BLAKE2b-256 | a037dcac203baad64ba2a3f8420ec522d8f37827e5cbabd464573bbb666a05d1 |
File details
Details for the file airflow_provider_hex-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: airflow_provider_hex-0.1.7-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c50312658c1103c39d3ae16a6a1cadb2bfaa825cc9ed28f150c60dde15bee595 |
|
MD5 | 650f36ee4e671000a1624dd8777dd240 |
|
BLAKE2b-256 | f46fef360c216e280b48abff43ebb8f5a0e2024eb2e0f0642c319840bfd49c41 |