cube-js / cube-js/cube

granularity field in timeDimensions removed in query @cubejs-client/vue3

Open
#7,379 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Describe the bug**
When a query with a dimension and a filter on the same dimension is passed, the load url ( and also the dry-run ) does not contains the field granularity.

**To Reproduce**
pass a query
` `
....

let cubequery =
{
"measures": [
"report.count_total1",
"report.count_total2"
],
"order": [
[
"report.timestamp",
"asc"
]
],
"dimensions": [
"report.protocol_name",
"report.owner_name"
],
"timeDimensions": [
{
"dimension": "report.timestamp",
"granularity": "day"
}
],
"filters": [
{
"member": "report.timestamp",
"operator": "inDateRange",
"values": [
"2021-10-01",
"2023-10-07"
]
},
{
"member": "report.owner_name",
"operator": "equals",
"values": [
"protocol1"
]
}
]
}

**Expected behavior**
Load query and also dry-contains full query in the payload, but the payload is:
{"measures":["report.count_total1","report.count_total2"],"dimensions":["report.protocol_name","report.owner_name"],"timeDimensions":[{"dimension":"report.timestamp"}],"filters":[{"member":"report.timestamp","operator":"inDateRange","values":["2021-10-01","2023-10-07"]},{"member":"report.owner_name","operator":"equals","values":["protocol1"]}],"limit":10000,"order":{"report.count_total":"desc"}}

Without the granularity, cube does not return the timestamp column.

**Version:**
Vue version: 3.3.4
cubejs-client/vue3: 0.33.0

**Additional context**
Seems like some reactivity issue

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.