Skip to content

Commit 3161d7a

Browse files
committed
document query_label session property
1 parent a5544e2 commit 3161d7a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/integrations/engines/bigquery.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,23 @@ If the `impersonated_service_account` argument is set, SQLMesh will:
193193

194194
The user account must have [sufficient permissions to impersonate the service account](https://cloud.google.com/docs/authentication/use-service-account-impersonation).
195195

196+
## Query Label
197+
198+
BigQuery supports a `query_label` session variable which is attached to query jobs and can be used for auditing / attribution.
199+
200+
SQLMesh supports setting it via `session_properties.query_label` on a model, as an array (or tuple) of key/value tuples.
201+
202+
Example:
203+
```sql
204+
MODEL (
205+
name my_project.my_dataset.my_model,
206+
dialect 'bigquery',
207+
session_properties (
208+
query_label = [('team', 'data_platform'), ('env', 'prod')]
209+
)
210+
);
211+
```
212+
196213
## Permissions Required
197214
With any of the above connection methods, ensure these BigQuery permissions are enabled to allow SQLMesh to work correctly.
198215

0 commit comments

Comments
 (0)