File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
packages/cubejs-schema-compiler/src/compiler Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -218,14 +218,26 @@ export class YamlCompiler {
218218 } else if ( typeof obj === 'string' ) {
219219 let code = obj ;
220220
221+ if ( obj === '' ) {
222+ return t . nullLiteral ( ) ;
223+ }
224+
225+ if ( code . match ( PY_TEMPLATE_SYNTAX ) ) {
226+ if ( ! nonStringFields . has ( propertyPath [ propertyPath . length - 1 ] ) ) {
227+ code = `f"${ this . escapeDoubleQuotes ( obj ) } "` ;
228+ }
229+
230+ const parsePythonAndTranspileToJsTimer225 = perfTracker . start ( 'parsePythonAndTranspileToJs call 225' ) ;
231+ const ast = this . parsePythonAndTranspileToJs ( code , errorsReport ) ;
232+ parsePythonAndTranspileToJsTimer225 . end ( ) ;
233+ return this . extractProgramBodyIfNeeded ( ast ) ;
234+ }
235+
221236 if ( ! nonStringFields . has ( propertyPath [ propertyPath . length - 1 ] ) ) {
222- code = `f" ${ this . escapeDoubleQuotes ( obj ) } "` ;
237+ return t . templateLiteral ( [ t . templateElement ( { raw : code , cooked : code } ) ] , [ ] ) ;
223238 }
224239
225- const parsePythonAndTranspileToJsTimer225 = perfTracker . start ( 'parsePythonAndTranspileToJs call 225' ) ;
226- const ast = this . parsePythonAndTranspileToJs ( code , errorsReport ) ;
227- parsePythonAndTranspileToJsTimer225 . end ( ) ;
228- return this . extractProgramBodyIfNeeded ( ast ) ;
240+ return t . identifier ( code ) ;
229241 } else if ( typeof obj === 'boolean' ) {
230242 return t . booleanLiteral ( obj ) ;
231243 } else if ( typeof obj === 'number' ) {
You can’t perform that action at this time.
0 commit comments