Skip to content

Commit 7a9c702

Browse files
authored
Update docs with default dialect specification (#1196)
1 parent e6dfee4 commit 7a9c702

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

docs/concepts/models/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Name is ***required*** and must be ***unique***.
7676
- Kind specifies what [kind](model_kinds.md) a model is. A model's kind determines how it is computed and stored. The default kind is `VIEW`, which means a view is created and your query is run each time that view is accessed. See [below](#incremental-model-properties) for properties that apply to incremental model kinds.
7777

7878
### dialect
79-
- Dialect defines the SQL dialect of the file. By default, this uses the dialect of the SQLMesh `sqlmesh.core.config`.
79+
- Dialect defines the SQL dialect of the model. By default, this uses the dialect in the [configuration file `model_defaults` `dialect` key](../../reference/configuration.md#model-configuration). All SQL dialects [supported by the SQLGlot library](https://github.com/tobymao/sqlglot/blob/main/sqlglot/dialects/__init__.py) are allowed.
8080

8181
### owner
8282
- Owner specifies who the main point of contact is for the model. It is an important field for organizations that have many data collaborators.

docs/guides/scheduling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ On the client side, you must configure the connection to your Airflow cluster in
7676

7777
Alternatively, the configuration above can be generated automatically as part of the project initialization using the `airflow` template:
7878
```bash
79-
sqlmesh init -t airflow
79+
sqlmesh init [PROJECT SQL DIALECT] -t airflow
8080
```
8181

8282
For Airflow configuration types specific to Google Cloud Composer, configure the file as follows:

docs/reference/notebook.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ import sqlmesh
2424

2525
### Quick start project
2626

27-
If desired, you can create the [quick start example project](../quick_start.md) with the Python `init_example_project` function:
27+
If desired, you can create the [quick start example project](../quick_start.md) with the Python `init_example_project` function. The function requires a default SQL dialect for the project's models; this example uses `snowflake`:
2828

2929
```python
3030
from sqlmesh.cli.example_project import init_example_project
3131

32-
init_example_project("path_to_project_directory")
32+
init_example_project("path_to_project_directory", dialect="snowflake")
3333
```
3434

3535
Alternatively, create the project with a notebook magic:
3636

3737
```python
38-
%init path_to_project_directory
38+
%init path_to_project_directory snowflake
3939
```
4040

4141
### Databricks notebooks
@@ -55,7 +55,7 @@ positional arguments:
5555

5656
## init
5757
```
58-
%init path sql_dialect [--template TEMPLATE]
58+
%init path sql_dialect [--template TEMPLATE]
5959
6060
Creates a SQLMesh project scaffold. Argument `sql_dialect` is required unless the dbt
6161
template option is specified.
@@ -78,13 +78,13 @@ options:
7878

7979
## plan
8080
```
81-
%plan [--start START] [--end END] [--latest LATEST]
81+
%plan environment [--start START] [--end END] [--latest LATEST]
8282
[--create-from CREATE_FROM] [--skip-tests]
8383
[--restate-model [RESTATE_MODEL ...]] [--no-gaps]
8484
[--skip-backfill] [--forward-only]
8585
[--effective-from EFFECTIVE_FROM] [--no-prompts] [--auto-apply]
8686
[--no-auto-categorization]
87-
[environment]
87+
8888
8989
Goes through a set of prompts to both establish a plan and apply it
9090
@@ -126,9 +126,8 @@ options:
126126

127127
## evaluate
128128
```
129-
%evaluate [--start START] [--end END] [--latest LATEST] [--limit LIMIT]
130-
model
131-
129+
%evaluate model [--start START] [--end END] [--latest LATEST] [--limit LIMIT]
130+
132131
Evaluate a model query and fetches a dataframe.
133132
134133
positional arguments:
@@ -146,9 +145,9 @@ options:
146145

147146
## render
148147
```
149-
%render [--start START] [--end END] [--latest LATEST] [--expand EXPAND]
148+
%render model [--start START] [--end END] [--latest LATEST] [--expand EXPAND]
150149
[--dialect DIALECT]
151-
model
150+
152151
153152
Renders a model's query, optionally expanding referenced models.
154153
@@ -181,7 +180,7 @@ positional arguments:
181180

182181
## test
183182
```
184-
%test [--ls] model [test_name]
183+
%test model [test_name] [--ls]
185184
186185
Allow the user to list tests for a model, output a specific test, and
187186
then write their changes back.

0 commit comments

Comments
 (0)