Skip to content

Commit 9c3b859

Browse files
authored
docs: Updates (#7209)
1 parent 6f4bdc2 commit 9c3b859

File tree

6 files changed

+103
-10
lines changed

6 files changed

+103
-10
lines changed

docs/docs-new/pages/product/apis-integrations/sql-api/security.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ module.exports = {
9696

9797
Now, you can use the `securityContext` in your data model:
9898

99-
```twig filename="model/cubes/users.yml.jinja"
99+
```twig filename="model/cubes/users.yml"
100100
{# Is the current team trusted? #}
101101
{% set trusted_teams = ['cx', 'exec' ] %}
102102
{% set is_trusted_team = COMPILE_CONTEXT.securityContext.team in trusted_teams %}

docs/docs-new/pages/product/configuration.mdx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,8 @@ Both ways are equivalent; when in doubt, use Python.
107107

108108
Support for Python and the `cube.py` file was introduced in v0.34.
109109

110-
As of v0.34, Cube uses Node 16.20 to execute JavaScript-based
111-
configuration and Python 3.9 for Python-based configuration.
112-
113110
</InfoBox>
114111

115-
When Cube starts, it will install dependencies in `package.json` via `yarn`
116-
and dependencies in `requirements.txt` via `pip`.
117-
118112
### Cube Core
119113

120114
When using Docker, ensure that the configuration file and your [data model
@@ -126,6 +120,18 @@ Docker container.
126120
You can edit the configuration file by going into <Btn>Development Mode</Btn>
127121
and navigating to the <Btn>Data Model</Btn> page.
128122

123+
## Runtime and dependencies
124+
125+
As of v0.34, Cube uses Node.js v16.20 to execute JavaScript-based
126+
configuration and Python v3.9 for Python-based configuration.
127+
128+
If you have dependencies in `requirements.txt` file, make sure to install
129+
them by running `pip install -r requirements.txt` inside the container.
130+
131+
If you have dependencies in `package.json` file, make sure to install them
132+
by running `yarn` and mount the `node_modules` folder under `/cube/conf`
133+
in the Docker container.
134+
129135
## Development Mode
130136

131137
Cube can be run in an insecure, development mode by setting the

docs/docs-new/pages/product/data-modeling/dynamic/jinja.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ Cube supports authoring dynamic data models using the [Jinja templating
44
language][jinja] and Python. This allows de-duplicating common patterns in your data models
55
as well as dynamically generating data models from a remote data source.
66

7-
To use a Jinja template, create a file in your data model folder with the
8-
`.jinja` extension. For example, a file containing the `orders` cube could be
9-
named `orders.yml.jinja` under the `models/` directory.
7+
Jinja is supported in all YAML data model files.
108

119
## Jinja
10+
11+
Please check the [Jinja documentation][jinja-docs] for details on Jinja syntax.
12+
1213
### Loops
1314

1415
Jinja supports [looping][jinja-docs-for-loop] over lists and dictionaries. In
@@ -196,6 +197,7 @@ cubes:
196197
```
197198

198199
[jinja]: https://jinja.palletsprojects.com/
200+
[jinja-docs]: https://jinja.palletsprojects.com/en/3.1.x/templates/
199201
[jinja-docs-for-loop]: https://jinja.palletsprojects.com/en/3.1.x/templates/#for
200202
[jinja-docs-macros]:
201203
https://jinja.palletsprojects.com/en/3.1.x/templates/#macros
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
22
"cube": "cube",
33
"cube_dbt": "cube_dbt",
4+
"lkml2cube": "lkml2cube",
45
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# `lkml2cube` package
2+
3+
`lkml2cube` package facilitates the migration from [Looker][link-looker]
4+
to Cube. It provides a convenient command-line tool for converting
5+
[LookML][link-lookml] models into the Cube data model.
6+
7+
* Install [`lkml2cube`][link-lkml2cube-pypi] package from PyPI
8+
* Check the source code in [`lkml2cube`][link-lkml2cube-repo] on GitHub
9+
* Submit issues to [`cube`][link-cube-repo-issues] on GitHub
10+
11+
## Installation
12+
13+
Run the following command:
14+
15+
```bash
16+
pip install lkml2cube
17+
```
18+
19+
## Usage
20+
21+
There are two commands: `cubes` and `views`. Both commands read all the
22+
files in the provided input parameter, including those referenced by the
23+
LookML keyword `include`.
24+
25+
### `cubes`
26+
27+
The `cubes` command would inspect LookML [views][link-lookml-views] and
28+
generate [cubes][ref-cubes].
29+
30+
Since join relationships are defined at the `explore` level in LookML
31+
syntax, generated cubes would not have [join][ref-joins] definitions.
32+
33+
#### Debugging
34+
35+
Run the following command to display a representation of a LookML object
36+
as a Python dictionary:
37+
38+
```bash
39+
lkml2cube cubes --parseonly path/to/file.view.lkml
40+
```
41+
42+
#### Converting
43+
44+
Run the following command to convert LookML [views][link-lookml-views]
45+
into [cubes][ref-cubes]:
46+
47+
```bash
48+
lkml2cube cubes path/to/file.view.lkml --outputdir ./
49+
```
50+
51+
### `views`
52+
53+
The `views` command would inspect LookML [explores][link-lookml-explores]
54+
and generate [cubes][ref-cubes] and [views][ref-views].
55+
56+
Since join relationships are defined at the `explore` level in LookML
57+
syntax, generated cubes and views would have [join][ref-joins] definitions.
58+
59+
#### Converting
60+
61+
Run the following command to convert LookML [explores][link-lookml-explores]
62+
into [cubes][ref-cubes] and [views][ref-views]:
63+
64+
```bash
65+
lkml2cube views path/to/file.explore.lkml --outputdir ./
66+
```
67+
68+
69+
[link-looker]: https://cloud.google.com/looker/
70+
[link-lookml]: https://cloud.google.com/looker/docs/reference/lookml-quick-reference
71+
[link-lookml-views]: https://cloud.google.com/looker/docs/reference/param-view
72+
[link-lookml-explores]: https://cloud.google.com/looker/docs/reference/param-explore
73+
[link-lkml2cube-repo]: https://github.com/cube-js/lkml2cube
74+
[link-lkml2cube-pypi]: https://pypi.org/project/lkml2cube/
75+
[link-cube-repo-issues]: https://github.com/cube-js/cube/issues
76+
77+
[ref-cubes]: /reference/data-model/cube
78+
[ref-views]: /reference/data-model/view
79+
[ref-joins]: /reference/data-model/joins

docs/docs-new/redirects.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[
2+
{
3+
"source": "/product/data-modeling/fundamentals/additional-concepts",
4+
"destination": "/product/data-modeling/concepts/subquery-dimensions",
5+
"permanent": true
6+
},
27
{
38
"source": "/product/data-modeling/advanced/using-dbt",
49
"destination": "/guides/dbt",

0 commit comments

Comments
 (0)