https://github.com/cube-js/dagster-cube
This library provides a resource to interact with Cube Cloud's REST API from Dagster.
https://github.com/cube-js/dagster-cube
Last synced: about 2 months ago
JSON representation
This library provides a resource to interact with Cube Cloud's REST API from Dagster.
- Host: GitHub
- URL: https://github.com/cube-js/dagster-cube
- Owner: cube-js
- Created: 2023-04-05T18:50:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-20T04:34:07.000Z (almost 2 years ago)
- Last Synced: 2024-04-17T04:59:35.311Z (about 1 year ago)
- Language: Python
- Size: 43 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dagster + Cube integration library
This library provides a [resource](https://docs.dagster.io/concepts/resources) to interact with Cube Cloud's REST API from Dagster.
## Installation
To install the library, use pip alongside your existing Dagster environment.
```bash
pip install dagster_cube
```## Methods
### make_request
Makes a request to the Cube API.Parameters:
- method (str): The http method use for this request (e.g. "GET", "POST")
- endpoint (str): The Cube API endpoint to send this request to.
- data (Optional(dict): Query parameters to pass to the API endpointReturns:
- Dict[str, Any]: Parsed json data from the response to this requestExample:
```python
my_cube_resource = CubeResource(
instance_url="https://intancexyz.cubecloudapp.dev/cubejs-api/v1/",
api_key="token"
)response = my_cube_resource.make_request(
method="POST",
endpoint="pre-aggregations/jobs",
data={
'action': 'post',
'selector': {
'preAggregations': ['MyCube.myPreAgg'],
'timezones': ['UTC'],
'contexts': [{'securityContext': {}}]
}
}
)
```