Community / Partner Supported
Push data assets to Cube
Push changes from upstream data sources to Cube's semantic layer.
About this integration
With the dagster_cube
integration you can setup Cube and Dagster to work together so that Dagster can push changes from upstream data sources to Cube via the Orchestration API.
Installation
pip install dagster_cube
Example
from dagster import asset
from dagster_cube import cube_resource
@asset
def cube_query_workflow():
my_cube_resource = CubeResource(
instance_url="https://<<INSTANCE>>.cubecloudapp.dev/cubejs-api/v1/",
api_key="abcdefghijklmnopqrstuvwxyz.1234567890"
)
response = my_cube_resource.make_request(
method="POST",
endpoint="load",
data={
'query': {
'measures': ['Orders.count'],
'dimensions': ['Orders.status']
}
}
)
return response
@asset
def cube_build_workflow():
my_cube_resource = CubeResource(
instance_url="https://<<INSTANCE>>.cubecloudapp.dev/cubejs-api/v1/",
api_key="abcdefghijklmnopqrstuvwxyz.1234567890"
)
response = my_cube_resource.make_request(
method="POST",
endpoint="pre-aggregations/jobs",
data={
'action': 'post',
'selector': {
'timezones': ['UTC'],
'contexts': [{'securityContext': {}}]
}
}
)
return response
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.
Community / Partner integration:
This integration was built and is maintained by a community user or a technology partner from outside of Dagster Labs.