dbt-labs / dbt-labs/dbt-adapters
[Feature] Change BigQuery `labels` to be additive instead of "clobber"
- Dominant language
- Python
- Stars
- 233
- Forks
- 362
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 9
Description
### Current Behavior
When we set labels in `dbt_project.yml`
```
finance:
+labels:
domain: finance
test: "yes"
```
and then extra ones in the model file
```
{{
config(
labels = {"type": "financial", "contains_pii": "yes"}
)
}}
```
The configuration of the model gets overwritten, even though the labels are different.

### Expected Behavior
I expected all labels to be applied and if a label is specified twice then for the single model configuration to take precedence.
### Steps To Reproduce
Create a sample model in folder `models/finance/finance_test.sql` and add the following configuration:
```
{{
config(
labels = {"type": "financial", "contains_pii": "yes"}
)
}}
```
In `dbt_project.yml` add the following configuration:
```
models:
project_name:
finance:
+labels:
domain: finance
test: yes
```
### Relevant log output
_No response_
### Environment
```markdown
- OS: Windows 10
- Python: 3.8.4rc1
- dbt: 1.7.7
- dbt-bigquery: 1.7.4
```
### Additional Context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.