Skip to main content

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.

Initial Setup

After creating a Hex API token, set up your Airflow Connection Credentials in the Airflow UI.

![/docs/hex-connection-setup.png]

  • 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[/airflow_provider_hex/operators/hex.py] 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[/airflow_provider_hex/hooks/hex.py] 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[/example_dags/example_hex.py]

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow-provider-hex-0.1.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

airflow_provider_hex-0.1.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file airflow-provider-hex-0.1.2.tar.gz.

File metadata

  • Download URL: airflow-provider-hex-0.1.2.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.2

File hashes

Hashes for airflow-provider-hex-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d85156d2114de5dafcb31bb96d0a2ba53bbb33afafd422aef918ed244a8562aa
MD5 8290fa8d3ae6444811346340c3070ef0
BLAKE2b-256 c168e70aa32cb36414215713bd4c8c329ef6720703c347260eb4440c85bb9408

See more details on using hashes here.

File details

Details for the file airflow_provider_hex-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_provider_hex-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d7735d977afa0c3dab3a40c9f5127c5164495b99ce1d84b11b79e6454c710ec8
MD5 4597c135581863a455fd0f58b74f7645
BLAKE2b-256 d219b38c57ec946d8916d38c1ad633c501becbb183c58cc3877b5fa0d95c7e67

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page