Skip to content

Commit e7864a7

Browse files
committed
Prepare transpileYaml in native + schema compiler
1 parent 1827a27 commit e7864a7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ export class DataSchemaCompiler {
704704
return undefined;
705705
}
706706

707+
// We update the yaml file content to the transpiled js content
708+
// and raise related flag so it will go JS transpilation flow afterward
709+
// avoiding costly YAML/Python parsing again.
707710
private async transpileYamlFile(
708711
file: FileContent,
709712
errorsReport: ErrorReporter,
@@ -751,14 +754,12 @@ export class DataSchemaCompiler {
751754

752755
this.compiledYamlCache.set(cacheKey, res.content);
753756

754-
return { ...file, content: res.content };
757+
return { ...file };
755758
} else {
756759
const transpiledFile = this.yamlCompiler.transpileYamlFile(file, errorsReport);
757760

758761
this.compiledYamlCache.set(cacheKey, transpiledFile?.content || '');
759762

760-
this.compiledYamlCache.set(cacheKey, transpiledFile?.content || '');
761-
762763
return transpiledFile;
763764
}
764765
}

0 commit comments

Comments
 (0)