Skip to content

Commit aaa1384

Browse files
committed
reuse yaml transpilation flow for jinja files
1 parent f2c5957 commit aaa1384

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -792,20 +792,16 @@ export class DataSchemaCompiler {
792792
private async transpileJinjaFile(
793793
file: FileContent,
794794
errorsReport: ErrorReporter,
795-
{ cubeNames, cubeSymbols, contextSymbols, transpilerNames, compilerId, stage }: TranspileOptions
795+
options: TranspileOptions
796796
): Promise<(FileContent | undefined)> {
797-
// if (getEnv('transpilationNative')) {
798-
//
799-
// } else if (getEnv('transpilationWorkerThreads')) {
800-
//
801-
// } else {
802-
return this.yamlCompiler.compileYamlWithJinjaFile(
797+
const renderedFile = this.yamlCompiler.compileYamlWithJinjaFile(
803798
file,
804799
errorsReport,
805800
this.standalone ? {} : this.cloneCompileContextWithGetterAlias(this.compileContext),
806801
this.pythonContext!
807802
);
808-
// }
803+
804+
return this.transpileYamlFile(renderedFile, errorsReport, options);
809805
}
810806

811807
public withQuery(query, fn) {

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,6 @@ export class YamlCompiler {
6565
};
6666
}
6767

68-
public async compileYamlWithJinjaFile(
69-
file: FileContent,
70-
errorsReport: ErrorReporter,
71-
compileContext: CompileContext,
72-
pythonContext: PythonCtx
73-
): Promise<FileContent | undefined> {
74-
const renderedFile = await this.renderTemplate(file, compileContext, pythonContext);
75-
76-
const transpileJinjaFileTimer2 = perfTracker.start('compile Jinja - transpileYamlFile');
77-
const res = this.transpileYamlFile(renderedFile, errorsReport);
78-
transpileJinjaFileTimer2.end();
79-
return res;
80-
}
81-
8268
public transpileYamlFile(
8369
file: FileContent,
8470
errorsReport: ErrorReporter,

0 commit comments

Comments
 (0)