Skip to content

Commit 584b3dc

Browse files
authored
feat(cubeclient): Add short_title to dimensions and measures (#9256)
1 parent a5598dd commit 584b3dc

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed

packages/cubejs-api-gateway/openspec.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ components:
127127
type: "string"
128128
title:
129129
type: "string"
130+
shortTitle:
131+
type: "string"
130132
description:
131133
type: "string"
132134
type:
@@ -150,6 +152,8 @@ components:
150152
type: "string"
151153
title:
152154
type: "string"
155+
shortTitle:
156+
type: "string"
153157
description:
154158
type: "string"
155159
type:

rust/cubesql/cubeclient/src/models/v1_cube_meta_dimension.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ pub struct V1CubeMetaDimension {
1414
pub name: String,
1515
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
1616
pub title: Option<String>,
17+
#[serde(rename = "shortTitle", skip_serializing_if = "Option::is_none")]
18+
pub short_title: Option<String>,
1719
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
1820
pub description: Option<String>,
1921
#[serde(rename = "type")]
@@ -32,6 +34,7 @@ impl V1CubeMetaDimension {
3234
V1CubeMetaDimension {
3335
name,
3436
title: None,
37+
short_title: None,
3538
description: None,
3639
r#type,
3740
alias_member: None,

rust/cubesql/cubeclient/src/models/v1_cube_meta_measure.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ pub struct V1CubeMetaMeasure {
1414
pub name: String,
1515
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
1616
pub title: Option<String>,
17+
#[serde(rename = "shortTitle", skip_serializing_if = "Option::is_none")]
18+
pub short_title: Option<String>,
1719
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
1820
pub description: Option<String>,
1921
#[serde(rename = "type")]
@@ -29,6 +31,7 @@ impl V1CubeMetaMeasure {
2931
V1CubeMetaMeasure {
3032
name,
3133
title: None,
34+
short_title: None,
3235
description: None,
3336
r#type,
3437
agg_type: None,

rust/cubesql/cubesql/benches/large_model.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ pub fn get_large_model_test_meta(dims: usize) -> Vec<V1CubeMeta> {
7777
V1CubeMetaMeasure {
7878
name: format!("{}.count", cube_name),
7979
title: None,
80+
short_title: None,
8081
description: None,
8182
r#type: "number".to_string(),
8283
agg_type: Some("count".to_string()),
@@ -85,6 +86,7 @@ pub fn get_large_model_test_meta(dims: usize) -> Vec<V1CubeMeta> {
8586
V1CubeMetaMeasure {
8687
name: format!("{}.sum", cube_name),
8788
title: None,
89+
short_title: None,
8890
description: None,
8991
r#type: "number".to_string(),
9092
agg_type: Some("sum".to_string()),

rust/cubesql/cubesql/src/compile/test/mod.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
9393
CubeMetaMeasure {
9494
name: "KibanaSampleDataEcommerce.count".to_string(),
9595
title: None,
96+
short_title: None,
9697
description: Some("Events count".to_string()),
9798
r#type: "number".to_string(),
9899
agg_type: Some("count".to_string()),
@@ -101,6 +102,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
101102
CubeMetaMeasure {
102103
name: "KibanaSampleDataEcommerce.maxPrice".to_string(),
103104
title: None,
105+
short_title: None,
104106
description: None,
105107
r#type: "number".to_string(),
106108
agg_type: Some("max".to_string()),
@@ -109,6 +111,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
109111
CubeMetaMeasure {
110112
name: "KibanaSampleDataEcommerce.sumPrice".to_string(),
111113
title: None,
114+
short_title: None,
112115
description: None,
113116
r#type: "number".to_string(),
114117
agg_type: Some("sum".to_string()),
@@ -117,6 +120,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
117120
CubeMetaMeasure {
118121
name: "KibanaSampleDataEcommerce.minPrice".to_string(),
119122
title: None,
123+
short_title: None,
120124
description: None,
121125
r#type: "number".to_string(),
122126
agg_type: Some("min".to_string()),
@@ -125,6 +129,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
125129
CubeMetaMeasure {
126130
name: "KibanaSampleDataEcommerce.avgPrice".to_string(),
127131
title: None,
132+
short_title: None,
128133
description: None,
129134
r#type: "number".to_string(),
130135
agg_type: Some("avg".to_string()),
@@ -133,6 +138,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
133138
CubeMetaMeasure {
134139
name: "KibanaSampleDataEcommerce.countDistinct".to_string(),
135140
title: None,
141+
short_title: None,
136142
description: None,
137143
r#type: "number".to_string(),
138144
agg_type: Some("countDistinct".to_string()),
@@ -189,6 +195,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
189195
CubeMetaMeasure {
190196
name: "Logs.agentCount".to_string(),
191197
title: None,
198+
short_title: None,
192199
description: None,
193200
r#type: "number".to_string(),
194201
agg_type: Some("countDistinct".to_string()),
@@ -197,6 +204,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
197204
CubeMetaMeasure {
198205
name: "Logs.agentCountApprox".to_string(),
199206
title: None,
207+
short_title: None,
200208
description: None,
201209
r#type: "number".to_string(),
202210
agg_type: Some("countDistinctApprox".to_string()),
@@ -221,6 +229,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
221229
measures: vec![CubeMetaMeasure {
222230
name: "NumberCube.someNumber".to_string(),
223231
title: None,
232+
short_title: None,
224233
description: None,
225234
r#type: "number".to_string(),
226235
agg_type: Some("number".to_string()),
@@ -250,6 +259,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
250259
r#type: "number".to_string(),
251260
agg_type: Some("number".to_string()),
252261
title: None,
262+
short_title: None,
253263
description: None,
254264
meta: None,
255265
})
@@ -258,6 +268,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
258268
CubeMetaMeasure {
259269
name: "WideCube.count".to_string(),
260270
title: None,
271+
short_title: None,
261272
description: None,
262273
r#type: "number".to_string(),
263274
agg_type: Some("count".to_string()),
@@ -266,6 +277,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
266277
CubeMetaMeasure {
267278
name: "WideCube.maxPrice".to_string(),
268279
title: None,
280+
short_title: None,
269281
description: None,
270282
r#type: "number".to_string(),
271283
agg_type: Some("max".to_string()),
@@ -274,6 +286,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
274286
CubeMetaMeasure {
275287
name: "WideCube.minPrice".to_string(),
276288
title: None,
289+
short_title: None,
277290
description: None,
278291
r#type: "number".to_string(),
279292
agg_type: Some("min".to_string()),
@@ -282,6 +295,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
282295
CubeMetaMeasure {
283296
name: "WideCube.avgPrice".to_string(),
284297
title: None,
298+
short_title: None,
285299
description: None,
286300
r#type: "number".to_string(),
287301
agg_type: Some("avg".to_string()),
@@ -290,6 +304,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
290304
CubeMetaMeasure {
291305
name: "WideCube.countDistinct".to_string(),
292306
title: None,
307+
short_title: None,
293308
description: None,
294309
r#type: "number".to_string(),
295310
agg_type: Some("countDistinct".to_string()),
@@ -342,6 +357,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
342357
r#type: "number".to_string(),
343358
agg_type: Some("number".to_string()),
344359
title: None,
360+
short_title: None,
345361
description: Some(format!("Test number measure {i}")),
346362
meta: None,
347363
},
@@ -350,6 +366,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
350366
r#type: "string".to_string(),
351367
agg_type: Some("max".to_string()),
352368
title: None,
369+
short_title: None,
353370
description: Some(format!("Test max(string) measure {i}")),
354371
meta: None,
355372
},
@@ -358,6 +375,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
358375
r#type: "time".to_string(),
359376
agg_type: Some("max".to_string()),
360377
title: None,
378+
short_title: None,
361379
description: Some(format!("Test max(time) measure {i}")),
362380
meta: None,
363381
},
@@ -368,6 +386,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
368386
CubeMetaMeasure {
369387
name: "MultiTypeCube.count".to_string(),
370388
title: None,
389+
short_title: None,
371390
description: Some("Test count measure".to_string()),
372391
r#type: "number".to_string(),
373392
agg_type: Some("count".to_string()),
@@ -376,6 +395,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
376395
CubeMetaMeasure {
377396
name: "MultiTypeCube.maxPrice".to_string(),
378397
title: None,
398+
short_title: None,
379399
description: Some("Test maxPrice measure".to_string()),
380400
r#type: "number".to_string(),
381401
agg_type: Some("max".to_string()),
@@ -384,6 +404,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
384404
CubeMetaMeasure {
385405
name: "MultiTypeCube.minPrice".to_string(),
386406
title: None,
407+
short_title: None,
387408
description: Some("Test minPrice measure".to_string()),
388409
r#type: "number".to_string(),
389410
agg_type: Some("min".to_string()),
@@ -392,6 +413,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
392413
CubeMetaMeasure {
393414
name: "MultiTypeCube.avgPrice".to_string(),
394415
title: None,
416+
short_title: None,
395417
description: Some("Test avgPrice measure".to_string()),
396418
r#type: "number".to_string(),
397419
agg_type: Some("avg".to_string()),
@@ -400,6 +422,7 @@ pub fn get_test_meta() -> Vec<CubeMeta> {
400422
CubeMetaMeasure {
401423
name: "MultiTypeCube.countDistinct".to_string(),
402424
title: None,
425+
short_title: None,
403426
description: Some("Test countDistinct measure".to_string()),
404427
r#type: "number".to_string(),
405428
agg_type: Some("countDistinct".to_string()),
@@ -428,6 +451,7 @@ pub fn get_string_cube_meta() -> Vec<CubeMeta> {
428451
measures: vec![CubeMetaMeasure {
429452
name: "StringCube.someString".to_string(),
430453
title: None,
454+
short_title: None,
431455
description: None,
432456
r#type: "string".to_string(),
433457
agg_type: Some("string".to_string()),
@@ -452,6 +476,7 @@ pub fn get_sixteen_char_member_cube() -> Vec<CubeMeta> {
452476
CubeMetaMeasure {
453477
name: "SixteenChar.sixteen_charchar".to_string(),
454478
title: None,
479+
short_title: None,
455480
description: None,
456481
r#type: "number".to_string(),
457482
agg_type: Some("sum".to_string()),
@@ -460,6 +485,7 @@ pub fn get_sixteen_char_member_cube() -> Vec<CubeMeta> {
460485
CubeMetaMeasure {
461486
name: "SixteenChar.sixteen_charchar_foo".to_string(),
462487
title: None,
488+
short_title: None,
463489
description: None,
464490
r#type: "number".to_string(),
465491
agg_type: Some("avg".to_string()),
@@ -468,6 +494,7 @@ pub fn get_sixteen_char_member_cube() -> Vec<CubeMeta> {
468494
CubeMetaMeasure {
469495
name: "SixteenChar.sixteen_charchar_bar".to_string(),
470496
title: None,
497+
short_title: None,
471498
description: None,
472499
r#type: "number".to_string(),
473500
agg_type: Some("count".to_string()),

0 commit comments

Comments
 (0)