Skip to content

Commit c72d253

Browse files
committed
2 parents f6aee9e + e749958 commit c72d253

135 files changed

Lines changed: 6748 additions & 2261 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/continue_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ jobs:
172172

173173
ui_test:
174174
docker:
175-
- image: mcr.microsoft.com/playwright:v1.53.2-jammy
175+
- image: mcr.microsoft.com/playwright:v1.54.1-jammy
176176
resource_class: medium
177177
steps:
178178
- halt_unless_client

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ repos:
2323
files: *files
2424
require_serial: true
2525
exclude: ^(tests/fixtures)
26+
- id: valid migrations
27+
name: valid migrations
28+
entry: tooling/validating_migration_numbers.sh
29+
language: system
30+
pass_filenames: false
117 KB
Loading
127 KB
Loading
231 KB
Loading
18.5 KB
Loading
56.1 KB
Loading

docs/cloud/features/upgrades.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Upgrading Tobiko Cloud
2+
3+
Tobiko regularly releases new versions of Tobiko Cloud that add features and improve reliability.
4+
5+
This page describes how to upgrade your Tobiko Cloud projects to a newer version.
6+
7+
## Upgrade availability
8+
9+
Navigate to `Settings > Upgrade` in the Tobiko Cloud UI to determine whether a new version of Tobiko Cloud is available for your project.
10+
11+
If your project is already up to date, you will see a grey message:
12+
13+
![Tobiko Cloud Upgrade Already Up-to-Date](./upgrade/upgrade-ui-up-to-date.png)
14+
15+
If a new version is available for your project, the page will include a notification box, version, and blue Upgrade Now button:
16+
17+
![Tobiko Cloud Upgrade Page](./upgrade/upgrade-ui-available.png)
18+
19+
## Upgrading a project
20+
21+
On the Upgrade page, you can choose to upgrade to the latest version or specify a custom version.
22+
23+
!!! info "Upgrade Permissions"
24+
Only users with Tobiko Cloud `Admin` permissions can perform upgrades.
25+
26+
!!! danger "Upgrade Side Effects"
27+
The upgrade process may take a few minutes to complete. During this time, your Tobiko Cloud project will be unavailable.
28+
29+
Any in-progress plans and runs will be aborted:
30+
31+
- Aborted plans will be stopped, and you must **manually** start them again.
32+
- Aborted runs will be automatically resumed shortly after the upgrade completes.
33+
34+
To avoid unexpected interruptions, please notify your team before starting the upgrade.
35+
36+
### Latest Version
37+
38+
Click the **Upgrade Now** button and confirm to begin upgrading your project to the latest version.
39+
40+
![Tobiko Cloud Upgrade Page](./upgrade/upgrade-ui-latest.png)
41+
42+
### Custom Version
43+
44+
We recommend upgrading your Tobiko Cloud project to the latest version, but you may prefer to upgrade to a specific version.
45+
46+
For example, consider a team that has separate staging and production Tobiko Cloud projects. They upgrade the staging project first, run tests, and only upgrade the production project after verifying that staging works as expected.
47+
48+
If a new version of Tobiko Cloud is released during this testing period, the latest available version will not match the version tested in staging. The team can specify a custom Tobiko Cloud version to upgrade production to the specific version that was already tested in staging.
49+
50+
To specify a custom version, select the **Custom** tab on the Upgrade page and enter your desired version in the text box.
51+
52+
![Tobiko Cloud Upgrade Custom Version](./upgrade/upgrade-ui-custom-version.png)
53+
54+
Make sure you are entering a valid custom version by:
55+
56+
- Entering the custom version **without** the leading `v`
57+
- Confirming that the version is valid and later than the current version of the project
58+
59+
If your custom version is not valid, Tobiko Cloud will display an error message.
60+
61+
After entering the custom version, click the **Upgrade Now** button and confirm to begin the upgrade process.
62+
63+
## Upgrade Progress
64+
65+
Tobiko Cloud will display a progress page while the upgrade is in progress:
66+
67+
![Tobiko Cloud Upgrade Progress](./upgrade/upgrade-ui-progress.png)
68+
69+
Once the upgrade is complete, Tobiko Cloud will automatically redirect you back to your upgraded project.
70+
71+
## Upgrade Support
72+
73+
If you encounter an issue during the upgrade process, please [report an incident](./incident_reporting.md). Our support team will follow up as soon as possible.
74+
75+
For the quickest response, we recommend upgrading Monday through Friday between 9am and 5pm PST.

docs/concepts/models/python_models.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ For example, pre/post-statements might modify settings or create indexes. Howeve
102102

103103
You can set the `pre_statements` and `post_statements` arguments to a list of SQL strings, SQLGlot expressions, or macro calls to define the model's pre/post-statements.
104104

105+
**Project-level defaults:** You can also define pre/post-statements at the project level using `model_defaults` in your configuration. These will be applied to all models in your project and merged with any model-specific statements. Default statements are executed first, followed by model-specific statements. Learn more about this in the [model configuration reference](../../reference/model_configuration.md#model-defaults).
106+
105107
``` python linenums="1" hl_lines="8-12"
106108
@model(
107109
"db.test_model",
@@ -182,6 +184,8 @@ These can be used, for example, to grant privileges on views of the virtual laye
182184

183185
Similar to pre/post-statements you can set the `on_virtual_update` argument in the `@model` decorator to a list of SQL strings, SQLGlot expressions, or macro calls.
184186

187+
**Project-level defaults:** You can also define on-virtual-update statements at the project level using `model_defaults` in your configuration. These will be applied to all models in your project (including Python models) and merged with any model-specific statements. Default statements are executed first, followed by model-specific statements. Learn more about this in the [model configuration reference](../../reference/model_configuration.md#model-defaults).
188+
185189
``` python linenums="1" hl_lines="8"
186190
@model(
187191
"db.test_model",
@@ -394,6 +398,35 @@ It's also possible to use the `@EACH` macro, combined with a global list variabl
394398
...
395399
```
396400

401+
## Using macros in model properties
402+
403+
Python models support macro variables in model properties. However, special care must be taken when the macro variable appears within a string.
404+
405+
For example when using macro variables inside cron expressions, you need to wrap the entire expression in quotes and prefix it with `@` to ensure proper parsing:
406+
407+
```python linenums="1"
408+
# Correct: Wrap the cron expression containing a macro variable
409+
@model(
410+
"my_model",
411+
cron="@'*/@{mins} * * * *'", # Note the @'...' syntax
412+
...
413+
)
414+
415+
# This also works with blueprint variables
416+
@model(
417+
"@{customer}.scheduled_model",
418+
cron="@'0 @{hour} * * *'",
419+
blueprints=[
420+
{"customer": "customer_1", "hour": 2}, # Runs at 2 AM
421+
{"customer": "customer_2", "hour": 8}, # Runs at 8 AM
422+
],
423+
...
424+
)
425+
426+
```
427+
428+
This is necessary because cron expressions often use `@` for aliases (like `@daily`, `@hourly`), which can conflict with SQLMesh's macro syntax.
429+
397430
## Examples
398431
### Basic
399432
The following is an example of a Python model returning a static Pandas DataFrame.

docs/concepts/models/seed_models.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ ALTER SESSION SET TIMEZONE = 'PST';
203203

204204
Seed models also support on-virtual-update statements, which are executed after the completion of the [Virtual Update](#virtual-update).
205205

206+
**Project-level defaults:** You can also define on-virtual-update statements at the project level using `model_defaults` in your configuration. These will be applied to all models in your project (including seed models) and merged with any model-specific statements. Default statements are executed first, followed by model-specific statements. Learn more about this in the [model configuration reference](../../reference/model_configuration.md#model-defaults).
207+
206208
These must be enclosed within an `ON_VIRTUAL_UPDATE_BEGIN;` ...; `ON_VIRTUAL_UPDATE_END;` block:
207209

208210
```sql linenums="1" hl_lines="8-13"

0 commit comments

Comments
 (0)