Skip to content

Commit 0d87f5d

Browse files
authored
chore: Use name instead of cube in cubes parameter (#6522)
* chore: Use name instead of cube in cubes parameter * Remove redundant logs * remove more redundant logs * clean up error message log * name -> join_path * Fix js test * make joinPath expression not string
1 parent feb3fe3 commit 0d87f5d

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed

packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export class CubeEvaluator extends CubeSymbols {
193193
*/
194194
membersFromCubes(cubes, type, errorReporter) {
195195
return R.unnest(cubes.map(cubeInclude => {
196-
const fullPath = this.evaluateReferences(null, cubeInclude.cube, { collectJoinHints: true });
196+
const fullPath = this.evaluateReferences(null, cubeInclude.joinPath, { collectJoinHints: true });
197197
const split = fullPath.split('.');
198198
const cubeReference = split[split.length - 1];
199199
const cubeName = cubeInclude.alias || cubeReference;

packages/cubejs-schema-compiler/src/compiler/CubeValidator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ const viewSchema = inherit(baseSchema, {
539539
excludes: Joi.func(),
540540
cubes: Joi.array().items(
541541
Joi.object().keys({
542-
cube: Joi.func().required(),
542+
joinPath: Joi.func().required(),
543543
prefix: Joi.boolean(),
544544
alias: Joi.string(),
545545
includes: Joi.alternatives([

packages/cubejs-schema-compiler/src/compiler/transpilers/CubePropContextTranspiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const transpiledFieldsPatterns: Array<RegExp> = [
1717
/^contextMembers$/,
1818
/^includes$/,
1919
/^excludes$/,
20-
/^cubes\.[0-9]+\.cube$/,
20+
/^cubes\.[0-9]+\.joinPath$/,
2121
];
2222

2323
export const transpiledFields: Set<String> = new Set<String>();

packages/cubejs-schema-compiler/src/compiler/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export function camelizeCube(cube: any): unknown {
4040
camelizeObjectPart(cube.measures, false);
4141
camelizeObjectPart(cube.dimensions, false);
4242
camelizeObjectPart(cube.preAggregations, false);
43+
camelizeObjectPart(cube.cubes, false);
4344

4445
return cube;
4546
}

packages/cubejs-schema-compiler/test/integration/postgres/yaml-compiler.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,14 @@ views:
348348
- name: orders_view
349349
350350
cubes:
351-
- cube: orders
351+
- join_path: orders
352352
prefix: true
353353
includes:
354354
- count
355355
- name: time
356356
alias: date
357357
358-
- cube: orders.customers
358+
- join_path: orders.customers
359359
alias: aliased_customers
360360
prefix: true
361361
includes:

packages/cubejs-testing/birdbox-fixtures/driver-test-data/ECommerce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ cube(`ECommerce`, {
120120

121121
view(`ECommerceView`, {
122122
cubes: [{
123-
cube: ECommerce,
123+
joinPath: ECommerce,
124124
includes: `*`,
125125
excludes: [`orderDate`]
126126
}]

0 commit comments

Comments
 (0)