Skip to content

Commit 47e353b

Browse files
committed
fix transform yaml joins
1 parent 6c12dba commit 47e353b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,13 @@ export class YamlCompiler {
135135
cubeObj.dimensions = this.yamlArrayToObj(cubeObj.dimensions || [], 'dimension', errorsReport);
136136
cubeObj.segments = this.yamlArrayToObj(cubeObj.segments || [], 'segment', errorsReport);
137137
cubeObj.preAggregations = this.yamlArrayToObj(cubeObj.preAggregations || [], 'preAggregation', errorsReport);
138+
138139
cubeObj.joins = cubeObj.joins || []; // For edge cases where joins are not defined/null
140+
if (!Array.isArray(cubeObj.joins)) {
141+
errorsReport.error('joins must be defined as array');
142+
cubeObj.joins = [];
143+
}
144+
139145
cubeObj.hierarchies = this.yamlArrayToObj(cubeObj.hierarchies || [], 'hierarchies', errorsReport);
140146

141147
return this.transpileYaml(cubeObj, [], cubeObj.name, errorsReport);

0 commit comments

Comments
 (0)