You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"If query-comment.job-label is set to true, dbt will include the query comment items, if a dictionary, or the comment string, as job labels on the query it executes. These will be included IN ADDITION TO labels specified in the BigQuery-specific config."
I then specify the following in dbt_project.yml:
query-comment:
job-label: True
Standard query comment items are then also transfered to job labels, but not model specific labels.
I would expect that model specific labels defined in the models config block or yml are transferred as job labels, in addition to being set in the table's metadata.
# Name your project! Project names should contain only lowercase characters
# and underscores. A good package name should reflect your organization's
# name or the intended use of these models
name: 'dbt_test'
version: '1.0.0'
# This setting configures which "profile" dbt uses for this project.
profile: 'dbt_test'
# These configurations specify where dbt should look for different types of files.
# The `model-paths` config, for example, states that models in this project can be
# found in the "models/" directory. You probably won't need to change these!
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"
# Configuring models
# Full documentation: https://docs.getdbt.com/docs/configuring-models
# In this example config, we tell dbt to build all models in the example/
# directory as views. These settings can be overridden in the individual model
# files using the `{{ config(...) }}` macro.
models:
dbt_test:
# Config indicated by + and applies to all files under models/example/
example:
+materialized: view
query-comment:
job-label: True
```
model:
```
{{ config(materialized='table', labels={'dummy_label': 'xyz'}) }}
select 1 as dummy
```
run:
```
15:58:34 Running with dbt=1.9.1
15:58:35 Registered adapter: bigquery=1.9.0
15:58:35 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.dbt_test.example
15:58:35 Found 1 model, 489 macros, 1 unit test
15:58:35
15:58:35 Concurrency: 1 threads (target='dev')
15:58:35
15:58:39 1 of 1 START sql table model SYS_TMP.dummy ..................................... [RUN]
15:58:41 1 of 1 OK created sql table model SYS_TMP.dummy ................................ [CREATE TABLE (1.0 rows, 0 processed) in 2.30s]
15:58:41
15:58:41 Finished running 1 table model in 0 hours 0 minutes and 6.18 seconds (6.18s).
15:58:41
15:58:41 Completed successfully
15:58:41
15:58:41 Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1
```
Resulting job has standard query comment items as job labels but not model specific ones:
![Image](https://github.com/user-attachments/assets/08b9884b-dd0c-4f8b-b7d5-4329833b4d8b)`
### Relevant log output
```shell
```
### Environment
```markdown
- OS:
- Python:
- dbt:
```
### Which database adapter are you using with dbt?
bigquery
### Additional Context
_No response_
The text was updated successfully, but these errors were encountered:
AndresVelasco
changed the title
[Bug] Big Query model labels not transmitted to job labels
[Bug] Big Query model-specific labels not transfered as job labels despite query-comment.job-label set to True
Feb 5, 2025
Is this a new bug in dbt-core?
Current Behavior
Documentation states:
https://docs.getdbt.com/reference/project-configs/query-comment#bigquery-include-query-comment-items-as-job-labels
"If query-comment.job-label is set to true, dbt will include the query comment items, if a dictionary, or the comment string, as job labels on the query it executes. These will be included IN ADDITION TO labels specified in the BigQuery-specific config."
I then specify the following in dbt_project.yml:
Standard query comment items are then also transfered to job labels, but not model specific labels.
Expected Behavior
I would expect that model specific labels defined in the models config block or yml are transferred as job labels, in addition to being set in the table's metadata.
Steps To Reproduce
profiles.yml:
dbt_project.yml:
The text was updated successfully, but these errors were encountered: