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 @@ -206,14 +206,26 @@ export class YamlCompiler {
206206 } else if ( typeof obj === 'string' ) {
207207 let code = obj ;
208208
209+ if ( obj === '' ) {
210+ return t . nullLiteral ( ) ;
211+ }
212+
213+ if ( code . match ( PY_TEMPLATE_SYNTAX ) ) {
214+ if ( ! nonStringFields . has ( propertyPath [ propertyPath . length - 1 ] ) ) {
215+ code = `f"${ this . escapeDoubleQuotes ( obj ) } "` ;
216+ }
217+
218+ const parsePythonAndTranspileToJsTimer225 = perfTracker . start ( 'parsePythonAndTranspileToJs call 225' ) ;
219+ const ast = this . parsePythonAndTranspileToJs ( code , errorsReport ) ;
220+ parsePythonAndTranspileToJsTimer225 . end ( ) ;
221+ return this . extractProgramBodyIfNeeded ( ast ) ;
222+ }
223+
209224 if ( ! nonStringFields . has ( propertyPath [ propertyPath . length - 1 ] ) ) {
210- code = `f" ${ this . escapeDoubleQuotes ( obj ) } "` ;
225+ return t . templateLiteral ( [ t . templateElement ( { raw : code , cooked : code } ) ] , [ ] ) ;
211226 }
212227
213- const parsePythonAndTranspileToJsTimer225 = perfTracker . start ( 'parsePythonAndTranspileToJs call 225' ) ;
214- const ast = this . parsePythonAndTranspileToJs ( code , errorsReport ) ;
215- parsePythonAndTranspileToJsTimer225 . end ( ) ;
216- return this . extractProgramBodyIfNeeded ( ast ) ;
228+ return t . identifier ( code ) ;
217229 } else if ( typeof obj === 'boolean' ) {
218230 return t . booleanLiteral ( obj ) ;
219231 } else if ( typeof obj === 'number' ) {
You can’t perform that action at this time.
0 commit comments