Skip to main content
The Cube sub-client provides access to the IYREE Cube.js API. Build type-safe analytics queries with the query builder or pass raw dicts.

Methods

load

Execute a Cube.js query. Handles JWT token refresh and “Continue wait” polling automatically.

Parameters

Dict[str, Any] | Query
required
A Query object (see Query builder below) or a raw Cube.js query dict.
float
Override for the continue-wait polling timeout in seconds. Defaults to cube_continue_wait_timeout from configuration.

Returns CubeQueryResult

List[Dict[str, Any]]
Result rows as a list of dictionaries.
Dict[str, Any]
Column annotation metadata from Cube.js (titles, types, formats).
Dict[str, Any]
The original query echoed back by Cube.js.
Dict[str, Any]
The full JSON response for advanced use cases.

Result methods

() -> pd.DataFrame
Convert to a pandas DataFrame. Requires iyree[pandas].

Errors


meta

Fetch Cube.js metadata — available cubes, measures, dimensions, and segments.

Parameters

float
Per-request timeout override in seconds.

Returns Dict[str, Any]

The raw metadata dict from Cube.js containing cubes, measures, dimensions, and segments.

Query builder

The SDK provides a typed query builder for constructing Cube.js queries. All classes are importable from the top-level iyree package.

Cube

Factory for creating measure, dimension, and segment references scoped to a cube name.
str
required
The cube name as defined in the Cube.js schema.

Methods

(str) -> Measure
Create a Measure reference. Serializes to "cube_name.measure_name".
(str) -> Dimension
Create a Dimension reference. Serializes to "cube_name.dimension_name".
(str) -> Segment
Create a Segment reference. Serializes to "cube_name.segment_name".

Query

Typed builder for Cube.js queries. Pass it to client.cube.load().

Parameters

List[Measure]
required
Measures to compute.
List[TimeDimension]
Time dimensions for filtering and grouping by time.
List[Dimension]
Dimensions for grouping results.
List[Filter]
Data filters to apply.
List[Segment]
Segments to apply.
int
default:"5000"
Maximum number of result rows.
int
default:"0"
Row offset for pagination.
List[Tuple[Dimension | Measure, Order]]
Ordering of result rows. Each element is a tuple of (member, direction).
str
default:"\"UTC\""
IANA timezone name applied to time dimensions (e.g. "America/New_York").
bool
default:"False"
If True, skip GROUP BY in the generated SQL — returns raw rows.

TimeDimension

Combination of a time dimension reference, date range, and granularity.
Dimension
required
Reference to a time-type dimension.
DateRange
Single date range for filtering. Provide either date_range or compare_date_range.
List[DateRange]
List of date ranges for period-over-period comparison.
TimeGranularity
default:"TimeGranularity.null"
Grouping granularity. When null, no time grouping is applied (filter only).

DateRange

Absolute or relative date range for time-dimension filtering. Provide either (start_date, end_date) or relative.
str
Start of the absolute range (YYYY-MM-DD or ISO-8601).
str
End of the absolute range.
str
Relative date expression understood by Cube.js.

Filter

A data filter applied to a measure or dimension.
Dimension | Measure
required
The dimension or measure to filter on.
FilterOperator
required
The filter operator (see FilterOperator).
List[Any]
Filter values. Values are stringified during serialization. Not required for operators like is_set and not_set.

And / Or

Boolean filter expressions for combining multiple filters.
Filter | BooleanExpression
required
Any number of Filter, And, or Or instances.

Enums

TimeGranularity

Order

FilterOperator


Examples