Skip to content

Commit

Permalink
Add guard for time series without daterange
Browse files Browse the repository at this point in the history
  • Loading branch information
KSDaemon committed Jan 27, 2025
1 parent 321eaec commit 1791127
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/cubejs-schema-compiler/src/adapter/BaseQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,10 @@ export class BaseQuery {
return baseQueryFn(cumulativeMeasures, filters, false);
}

if (this.timeDimensions.filter(d => !d.dateRange && d.granularity).length > 0) {
throw new UserError('Time series queries without dateRange aren\'t supported');
}

// We can't do meaningful query if few time dimensions with different ranges passed,
// it won't be possible to join them together without loosing some rows.
const rangedTimeDimensions = this.timeDimensions.filter(d => d.dateRange && d.granularity);
Expand Down

0 comments on commit 1791127

Please sign in to comment.