Skip to content

Commit 97bfc28

Browse files
authored
Merge branch 'SQLMesh:main' into feature/DRM/resolve-indirect-non-breaking-deployable-representative-mismatch
2 parents a74d550 + 869248c commit 97bfc28

40 files changed

Lines changed: 555 additions & 73 deletions

.github/workflows/pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ jobs:
457457
strategy:
458458
fail-fast: false
459459
matrix:
460-
dbt-version: ['1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '1.10']
460+
dbt-version: ['1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '1.10', '1.11']
461461
steps:
462462
- uses: actions/checkout@v7
463463
- name: Set up Python

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ install-dev-dbt-%:
3333
echo "Installing dbt version: $$version"; \
3434
cp pyproject.toml pyproject.toml.backup; \
3535
$(SED_INPLACE) 's/"pydantic>=2.0.0"/"pydantic"/g' pyproject.toml; \
36-
if [ "$$version" = "1.10.0" ]; then \
37-
echo "Applying special handling for dbt 1.10.0"; \
36+
if [ "$$version" = "1.10.0" ] || [ "$$version" = "1.11.0" ]; then \
37+
echo "Applying special handling for dbt $$version"; \
3838
$(SED_INPLACE) -E 's/"(dbt-core)[^"]*"/"\1~='"$$version"'"/g' pyproject.toml; \
3939
$(SED_INPLACE) -E 's/"(dbt-(bigquery|duckdb|snowflake|athena-community|clickhouse|redshift|trino))[^"]*"/"\1"/g' pyproject.toml; \
4040
$(SED_INPLACE) -E 's/"(dbt-databricks)[^"]*"/"\1~='"$$version"'"/g' pyproject.toml; \

docs/concepts/models/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ This table lists each engine's support for `TABLE` and `VIEW` object comments:
190190
| Redshift | Y | N |
191191
| Snowflake | Y | Y |
192192
| Spark | Y | Y |
193+
| StarRocks | Y | Y |
193194
| Trino | Y | Y |
194195

195196

docs/concepts/overview.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ Bad data is worse than no data. The best way to keep bad data out of your system
5252
### [Tests](./tests.md)
5353
SQLMesh "tests" are similar to unit tests in software development, where the unit is a single model. SQLMesh tests validate model *code* — you specify the input data and expected output, then SQLMesh runs the test and compares the expected and actual output.
5454

55-
SQLMesh automatically runs tests when you apply a `plan`, or you can run them on demand with the [`test` command](../reference/cli.md#test).
55+
SQLMesh automatically runs all unit tests when a `plan` is created. Use `--test-changed-only` to run tests only for models included in the plan (added, modified, or restated), `--skip-tests` to skip, run tests for specific models with [`sqlmesh test --select-model`](../reference/cli.md#test), or run the full suite on demand with the [`test` command](../reference/cli.md#test).
56+
57+
Learn more in the [testing guide](../guides/testing.md).
5658

5759
### [Audits](./audits.md)
5860
In contrast to tests, SQLMesh "audits" validate the results of model code applied to your actual data.

docs/concepts/tests.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Testing
22

3-
Testing allows you to protect your project from regression by continuously verifying that the output of each model matches your expectations. Unlike [audits](audits.md), tests are executed either on demand (for example, as part of a CI/CD job) or every time a new [plan](plans.md) is created.
3+
Testing allows you to protect your project from regression by continuously verifying that the output of each model matches your expectations. Unlike [audits](audits.md), tests are executed either on demand (for example, as part of a CI/CD job or via [`sqlmesh test`](../reference/cli.md#test)) or when a new [plan](plans.md) is created.
4+
5+
By default, `sqlmesh plan` runs all unit tests. Use `--test-changed-only` to run tests only for models included in the plan (added, modified, or restated), or `--skip-tests` to run none. With both `--select-model` and `--test-changed-only`, tests run only for selected models that changed.
46

57
Similar to unit testing in software development, SQLMesh evaluates the model's logic against predefined inputs and then compares the output to expected outcomes provided as part of each test.
68

docs/faq/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
SQLMesh's default behavior is appropriate for most deployments, but you can override where SQLMesh creates physical tables and views with [schema configuration options](../guides/configuration.md#environment-schemas).
103103

104104
??? question "What's the difference between a `test` and an `audit`?"
105-
A SQLMesh [`test`](../concepts/tests.md) is analogous to a "unit test" in software engineering. It tests *code* based on known inputs and outputs. In SQLMesh, the inputs and outputs are specified in a YAML file, and SQLMesh automatically runs them when `sqlmesh plan` is executed.
105+
A SQLMesh [`test`](../concepts/tests.md) is analogous to a "unit test" in software engineering. It tests *code* based on known inputs and outputs. In SQLMesh, the inputs and outputs are specified in a YAML file, and SQLMesh runs all unit tests when `sqlmesh plan` is executed (use `--test-changed-only` to run only tests for models in the plan).
106106

107107
Writing YAML is annoying and error-prone, so SQLMesh's [`create_test` command](../concepts/tests.md#automatic-test-generation) allows you to automatically generate YAML test files based on queries of existing data tables.
108108

docs/guides/configuration.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,19 +929,22 @@ Example snowflake connection configuration:
929929
These pages describe the connection configuration options for each execution engine.
930930

931931
* [Athena](../integrations/engines/athena.md)
932+
* [Azure SQL](../integrations/engines/azuresql.md)
932933
* [BigQuery](../integrations/engines/bigquery.md)
934+
* [ClickHouse](../integrations/engines/clickhouse.md)
933935
* [Databricks](../integrations/engines/databricks.md)
934936
* [DuckDB](../integrations/engines/duckdb.md)
935937
* [Fabric](../integrations/engines/fabric.md)
936938
* [MotherDuck](../integrations/engines/motherduck.md)
937-
* [MySQL](../integrations/engines/mysql.md)
938939
* [MSSQL](../integrations/engines/mssql.md)
940+
* [MySQL](../integrations/engines/mysql.md)
939941
* [Postgres](../integrations/engines/postgres.md)
940942
* [GCP Postgres](../integrations/engines/gcp-postgres.md)
941943
* [Redshift](../integrations/engines/redshift.md)
944+
* [RisingWave](../integrations/engines/risingwave.md)
942945
* [Snowflake](../integrations/engines/snowflake.md)
943-
* [StarRocks](../integrations/engines/starrocks.md)
944946
* [Spark](../integrations/engines/spark.md)
947+
* [StarRocks](../integrations/engines/starrocks.md)
945948
* [Trino](../integrations/engines/trino.md)
946949

947950
#### State connection

docs/guides/connections.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,20 @@ default_gateway: local_db
7979

8080
## Supported engines
8181

82+
* [Athena](../integrations/engines/athena.md)
83+
* [Azure SQL](../integrations/engines/azuresql.md)
8284
* [BigQuery](../integrations/engines/bigquery.md)
85+
* [ClickHouse](../integrations/engines/clickhouse.md)
8386
* [Databricks](../integrations/engines/databricks.md)
8487
* [DuckDB](../integrations/engines/duckdb.md)
88+
* [Fabric](../integrations/engines/fabric.md)
8589
* [MotherDuck](../integrations/engines/motherduck.md)
86-
* [MySQL](../integrations/engines/mysql.md)
8790
* [MSSQL](../integrations/engines/mssql.md)
91+
* [MySQL](../integrations/engines/mysql.md)
8892
* [Postgres](../integrations/engines/postgres.md)
8993
* [GCP Postgres](../integrations/engines/gcp-postgres.md)
9094
* [Redshift](../integrations/engines/redshift.md)
95+
* [RisingWave](../integrations/engines/risingwave.md)
9196
* [Snowflake](../integrations/engines/snowflake.md)
9297
* [Spark](../integrations/engines/spark.md)
9398
* [StarRocks](../integrations/engines/starrocks.md)

docs/guides/models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Reverting to a previous model version is a quick operation since no additional w
161161
162162
SQLMesh automatically validates your models in order to ensure the quality and accuracy of your data. This is done via the following:
163163
164-
* Running unit tests by default when you execute the `plan` command. This ensures all changes to applied to any environment are logically validated. Refer to [testing](../concepts/tests.md) for more information.
164+
* Running all unit tests when you execute the `plan` command (use `--test-changed-only` to run only tests for models in the plan). This ensures changes applied to any environment are logically validated. Refer to [testing](../concepts/tests.md) for more information.
165165
* Running audits whenever data is loaded to a table (either for backfill or loading on a cadence). This way you know all data present in any table has passed all defined audits. Refer to [auditing](../concepts/audits.md) for more information.
166166
167167
SQLMesh also provides automatic validation via CI/CD by automatically creating a preview environment.

docs/guides/testing.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,19 @@ OK
1212
```
1313
As the unit tests run, SQLMesh will identify any that fail.
1414

15+
By default, `sqlmesh plan` runs all unit tests. Use `--test-changed-only` to run tests only for models included in the plan (added, modified, or restated), or `--skip-tests` to run none. With both `--select-model` and `--test-changed-only`, tests run only for selected models that changed.
16+
1517
For more information about tests, refer to [testing](../concepts/tests.md).
1618

1719
### Test changes to a specific model
1820

19-
To run a specific model test, pass in the suite file name followed by `::` and the name of the test; for example: `sqlmesh test tests/test_suite.yaml::test_example_full_model`.
21+
To run unit tests for a specific model, use `--select-model`:
22+
23+
```bash
24+
$ sqlmesh test --select-model sqlmesh_example.full_model
25+
```
26+
27+
Alternatively, pass in the suite file name followed by `::` and the name of the test; for example: `sqlmesh test tests/test_suite.yaml::test_example_full_model`.
2028

2129
### Run a subset of tests
2230

0 commit comments

Comments
 (0)