Dagster & Cube
With the Cube integration you can setup Cube and Dagster to work together so that Dagster can push changes from upstream data sources to Cube using its integration API.
Installation
- uv
- pip
uv add dagster-cube
pip install dagster-cube
Example
from dagster_cube import CubeResource
import dagster as dg
@dg.asset
def cube_query_workflow(cube: CubeResource):
response = cube.make_request(
method="POST",
endpoint="load",
data={"query": {"measures": ["Orders.count"], "dimensions": ["Orders.status"]}},
)
return response
defs = dg.Definitions(
assets=[cube_query_workflow],
resources={
"cube": CubeResource(
instance_url="https://<<INSTANCE>>.cubecloudapp.dev/cubejs-api/v1/",
api_key=dg.EnvVar("CUBE_API_KEY"),
)
},
)
About Cube
Cube.js is the semantic layer for building data applications. It helps data engineers and application developers access data from modern data stores, organize it into consistent definitions, and deliver it to every application.