Incorrect YAML data model generated for uppercase schema/table names
- Dominant language
- Rust
- Stars
- 20.8k
- Forks
- 2.1k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 181
Description
**Describe the bug**
**version**
Cube Store (0.33.14)
Cube API server (0.33.14)
```
YAMLException: bad indentation of a mapping entry (3:16)
1 | cubes:
2 | - name: c_a_m_p_a_i_g_n_emails
3 | sql_table: `ODS`.`CAMPAIGN_EMAILS`
--------------------^
4 | data_source: default
5 |
at generateError (/cube/node_modules/js-yaml/lib/loader.js:183:10)
at throwError (/cube/node_modules/js-yaml/lib/loader.js:187:9)
at readBlockMapping (/cube/node_modules/js-yaml/lib/loader.js:1182:7)
at composeNode (/cube/node_modules/js-yaml/lib/loader.js:1441:12)
at readBlockSequence (/cube/node_modules/js-yaml/lib/loader.js:1008:5)
at composeNode (/cube/node_modules/js-yaml/lib/loader.js:1440:12)
at readBlockMapping (/cube/node_modules/js-yaml/lib/loader.js:1164:11)
at composeNode (/cube/node_modules/js-yaml/lib/loader.js:1441:12)
at readDocument (/cube/node_modules/js-yaml/lib/loader.js:1625:3)
at loadDocuments (/cube/node_modules/js-yaml/lib/loader.js:1688:5)
at Object.load (/cube/node_modules/js-yaml/lib/loader.js:1714:19)
at YamlCompiler.compileYamlFile (/cube/node_modules/@cubejs-backend/schema-compiler/src/compiler/YamlCompiler.ts:36:26)
at DataSchemaCompiler.compileFile (/cube/node_modules/@cubejs-backend/schema-compiler/src/compiler/DataSchemaCompiler.js:175:25)
at /cube/node_modules/@cubejs-backend/schema-compiler/src/compiler/DataSchemaCompiler.js:144:14
at Array.forEach ()
at DataSchemaCompiler.compileCubeFiles (/cube/node_modules/@cubejs-backend/schema-compiler/src/compiler/DataSchemaCompiler.js:143:8)
at compilePhase (/cube/node_modules/@cubejs-backend/schema-compiler/src/compiler/DataSchemaCompiler.js:61:50)
at /cube/node_modules/@cubejs-backend/schema-compiler/src/compiler/DataSchemaCompiler.js:63:16
at CompilerApi.getCompilers (/cube/node_modules/@cubejs-backend/server-core/src/core/CompilerApi.js:58:26)
at CompilerApi.metaConfig (/cube/node_modules/@cubejs-backend/server-core/src/core/CompilerApi.js:203:13)
at ApiGateway.meta (/cube/node_modules/@cubejs-backend/api-gateway/src/gateway.ts:510:26)
at /cube/node_modules/@cubejs-backend/api-gateway/src/gateway.ts:315:11
```
**To Reproduce**
After selecting the `Data Model` tab on the playground, I ticked some tables and then clicked `Generate Data Model` to generate the models with `YAML` format.
. Then I select the tab `Playground` and the error of bad indentation pops up.
**workaround**
Add double quotes to the string of `sql_table`. For example, sql_table: "\`ODS\`.\`CAMPAIGN_EMAILS\`"
Contributor guide
Assessment
This issue has not been assessed yet.