diff --git a/docs/pages/guides/style-guide.mdx b/docs/pages/guides/style-guide.mdx index aeb5886c0f995..69ddbd0a6f12b 100644 --- a/docs/pages/guides/style-guide.mdx +++ b/docs/pages/guides/style-guide.mdx @@ -19,8 +19,7 @@ This style guide is intended to be used by: ## Syntax -- Default to [YAML syntax][ref-syntax-model] for data modeling. Use JavaScript - syntax for dynamic data models only. +- Default to [YAML syntax][ref-syntax-model] for data modeling. - Use [snake case][ref-syntax-naming] when using either YAML or JavaScript syntax. - Follow the recommendations on [YAML syntax][self-yaml] and [SQL diff --git a/docs/pages/product/data-modeling/syntax.mdx b/docs/pages/product/data-modeling/syntax.mdx index 65f3fa91eabaa..ffffadbb46487 100644 --- a/docs/pages/product/data-modeling/syntax.mdx +++ b/docs/pages/product/data-modeling/syntax.mdx @@ -37,7 +37,8 @@ model Cube supports two ways to define data model files: with [YAML][wiki-yaml] or JavaScript syntax. YAML data model files should have the `.yml` extension, -whereas JavaScript data model files should end with `.js`. +whereas JavaScript data model files should end with `.js`. You can mix YAML and +JavaScript files within a single data model. @@ -63,11 +64,15 @@ cubes: -You define the data model statically or build [dynamic data +You can define the data model statically or build [dynamic data models][ref-dynamic-data-models] programmatically. YAML data models use [Jinja and Python][ref-dynamic-data-models-jinja] whereas JavaScript data models use [JavaScript][ref-dynamic-data-models-js]. +It is [recommended][ref-style-guide] to default to YAML syntax because of its +simplicity and readability. However, JavaScript might provide more flexibility +for dynamic data modeling. + ## Naming Common rules apply to names of entities within the data model. All names must: @@ -586,4 +591,5 @@ defining dynamic data models. [wiki-yaml]: https://en.wikipedia.org/wiki/YAML [link-snowflake-listagg]: https://docs.snowflake.com/en/sql-reference/functions/listagg [link-bigquery-stringagg]: https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#string_agg -[link-sql-udf]: https://en.wikipedia.org/wiki/User-defined_function#Databases \ No newline at end of file +[link-sql-udf]: https://en.wikipedia.org/wiki/User-defined_function#Databases +[ref-style-guide]: /guides/style-guide \ No newline at end of file