Skip to main content

Dagster integration with Hex

Project description

Dagster Hex Integration

Installation

To install the library, use pip alongside your existing Dagster environment.

pip install dagster-hex

Usage

Create a HexResource specifying the api_key, then, use that resource in our assets.

import os
import dagster as dg

from dagster_hex.resources import HexResource 


@dg.asset
def custom_hex_asset(
    context: dg.AssetExecutionContext,
    hex: HexResource
) -> dg.MaterializeResult:
    project_id = "abcdefgh-1234-abcd-1234-abcdefghijkl"
    context.log.info(f"Running Hex project {project_id}")
    response = hex.run_project(
        project_id,
        inputs={
            "message": "Hello, World!"
        }
    )
    return dg.MaterializeResult(
        metadata={
            "data": response.get("data")
        }
    )


defs = Definitions(
    assets=[custom_hex_asset],
    resources={
        "hex": HexResource(
            api_key=dg.EnvVar("HEX_API_KEY")
        )
    }
)

Legacy

Ops

The hex_project_op will call the Hex API to run a project until it completes.

import os
import dagster as dg

from dagster_hex.ops import hex_project_op
from dagster_hex.resources import hex_resource


hex_resource = HexResource(
    api_key=dg.EnvVar("HEX_API_KEY")
)

run_hex_op = hex_project_op.configured({
    "name": "run_hex_project_op",
    "project_id": "abcdefgh-1234-abcd-1234-abcdefghijkl"
})

@job(resource_defs={"hex": my_resource})
def hex_job():
    run_hex_op()
Asset Materializations

Ops will return an AssetMaterialization with the following keys:

run_url	
run_status_url	
trace_id	
run_id	
elapsed_time
notifications	

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

dagster_hex-0.1.4.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dagster_hex-0.1.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file dagster_hex-0.1.4.tar.gz.

File metadata

  • Download URL: dagster_hex-0.1.4.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for dagster_hex-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3d67e2de886bb82327c5e7a8bc98bad65e2f0a5b7bc952b4ffd90b2d4c6028d5
MD5 141c2a7cb2710e23b44144ae5b196737
BLAKE2b-256 13039c65fc1ced6fc3e44d9513118a8e8e213114cd0f46f93039eb60f296c807

See more details on using hashes here.

File details

Details for the file dagster_hex-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for dagster_hex-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 27cd84ec34f2fed965d9ff2aa49218020f68af217e7363a5849b0af789fe0f56
MD5 f7bf37addac3b604d4f358f6928d106b
BLAKE2b-256 9080e4e7b60b9379dff4d529da474342f5a34c9310d929ea9755f13b9557613a

See more details on using hashes here.

Supported by

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