File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
packages/cubejs-schema-compiler/src/compiler Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,16 @@ export class YamlCompiler {
5353 } ) ;
5454 }
5555
56+ public async renderTemplate ( file : FileContent , compileContext , pythonContext : PythonCtx ) : Promise < FileContent > {
57+ return {
58+ fileName : file . fileName ,
59+ content : await this . getJinjaEngine ( ) . renderTemplate ( file . fileName , compileContext , {
60+ ...pythonContext . functions ,
61+ ...pythonContext . variables
62+ } ) ,
63+ } ;
64+ }
65+
5666 public async compileYamlWithJinjaFile (
5767 file : FileContent ,
5868 errorsReport : ErrorReporter ,
@@ -63,15 +73,9 @@ export class YamlCompiler {
6373 toCompile ,
6474 compiledFiles ,
6575 compileContext ,
66- pythonContext
76+ pythonContext : PythonCtx
6777 ) {
68- const compiledFile = {
69- fileName : file . fileName ,
70- content : await this . getJinjaEngine ( ) . renderTemplate ( file . fileName , compileContext , {
71- ...pythonContext . functions ,
72- ...pythonContext . variables
73- } ) ,
74- } ;
78+ const compiledFile = await this . renderTemplate ( file , compileContext , pythonContext ) ;
7579
7680 return this . compileYamlFile (
7781 compiledFile ,
You can’t perform that action at this time.
0 commit comments