cube-js/cube · error
Inconsistent QueryTimeDimension configuration: dateRange req
Error message
Inconsistent QueryTimeDimension configuration: dateRange required.
What it means
Raised in get_date_range_value while building a compare date range plan: time dimensions were supplied to the query, but the first time dimension carries no dateRange. Compare date range queries derive their boundaries entirely from that dateRange, so its absence leaves the transform with nothing to compare.
Source
Thrown at rust/cube/cubeorchestrator/src/query_result_transform.rs:241
}
/// Parse date range value from time dimension.
pub fn get_date_range_value(
time_dimensions: Option<&Vec<QueryTimeDimension>>,
) -> Result<DBResponsePrimitive> {
let time_dimensions = match time_dimensions {
Some(time_dimensions) => time_dimensions,
None => bail!("QueryTimeDimension should be specified for the compare date range query."),
};
let dim = match time_dimensions.first() {
Some(dim) => dim,
None => bail!("No time dimension provided."),
};
let date_range: &Vec<String> = match &dim.date_range {
Some(date_range) => date_range,
None => bail!("Inconsistent QueryTimeDimension configuration: dateRange required."),
};
if date_range.len() == 1 {
bail!(
"Inconsistent dateRange configuration for the compare date range query: {}",
date_range[0]
);
}
Ok(DBResponsePrimitive::String(
date_range.join(COMPARE_DATE_RANGE_SEPARATOR),
))
}
/// Parse blending query key from time dimension for query.
pub fn get_blending_query_key(time_dimensions: Option<&Vec<QueryTimeDimension>>) -> Result<String> {
let dim = time_dimensions
.and_then(|dims| dims.first().cloned())View on GitHub (pinned to 7d981676b3)
Solutions
- Include a dateRange (a pair such as ['2024-01-01','2024-01-31'], or a named range like 'last 7 days') on the timeDimension of the compareDateRange query
- If building the query programmatically, verify the serializer actually emitted dateRange for the time dimension
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at rust/cube/cubeorchestrator/src/query_result_transform.rs:241 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/363ff29e501452e8.
Report an issue: GitHub.