Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions packages/cubejs-schema-compiler/src/compiler/YamlCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@
});
}

public async renderTemplate(file: FileContent, compileContext, pythonContext: PythonCtx): Promise<FileContent> {
return {

Check warning on line 57 in packages/cubejs-schema-compiler/src/compiler/YamlCompiler.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L57 was not covered by tests
fileName: file.fileName,
content: await this.getJinjaEngine().renderTemplate(file.fileName, compileContext, {
...pythonContext.functions,
...pythonContext.variables
}),
};
}

public async compileYamlWithJinjaFile(
file: FileContent,
errorsReport: ErrorReporter,
Expand All @@ -63,15 +73,9 @@
toCompile,
compiledFiles,
compileContext,
pythonContext
pythonContext: PythonCtx
) {
const compiledFile = {
fileName: file.fileName,
content: await this.getJinjaEngine().renderTemplate(file.fileName, compileContext, {
...pythonContext.functions,
...pythonContext.variables
}),
};
const compiledFile = await this.renderTemplate(file, compileContext, pythonContext);

Check warning on line 78 in packages/cubejs-schema-compiler/src/compiler/YamlCompiler.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L78 was not covered by tests

return this.compileYamlFile(
compiledFile,
Expand Down
Loading