Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Change BigQuery labels to be additive instead of "clobber" #1091

Open
moseleyi opened this issue Feb 6, 2024 · 8 comments
Open
Labels
enhancement New feature or request

Comments

@moseleyi
Copy link

moseleyi commented Feb 6, 2024

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.

image

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

- OS: Windows 10
- Python: 3.8.4rc1
- dbt: 1.7.7
- dbt-bigquery: 1.7.4

Additional Context

No response

@dbeatty10
Copy link
Contributor

Thanks for reaching out @moseleyi !

Based on the docs here, this looks like the intended behavior rather than a bug.

So I'm going to close this as "not planned".

In order to make the documentation for the labels config in dbt-bigquery more clear, I've opened this issue: dbt-labs/docs.getdbt.com#4864

@dbeatty10 dbeatty10 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
@dbeatty10 dbeatty10 added wontfix This will not be worked on and removed triage labels Feb 6, 2024
@moseleyi
Copy link
Author

moseleyi commented Feb 7, 2024

Why wouldn't you plan it? Having it like it is right now, diminishes the usability of this feature.

It's expected as per the docs but surely they should be additive? They should work just like tags

@dbeatty10
Copy link
Contributor

@graciegoheen and I discussed this briefly.

The current (non-additive) behavior of labels is clearly documented, so it is not a bug. But we're open to recategorizing this as a feature request to get a feel if others are interested in this as well.

At this point, it's not a priority for us, and I'm labeling this as "refinement" for us to determine at some point in the future if we'd want to adopt this or not.

In the meantime, you could take a look at what others have done as a workaround here.

@dbeatty10 dbeatty10 reopened this Feb 10, 2024
@dbeatty10 dbeatty10 added enhancement New feature or request refinement Product or leadership input needed and removed bug Something isn't working wontfix This will not be worked on labels Feb 10, 2024
@dbeatty10 dbeatty10 changed the title [Bug] BigQuery labels in model and dbt_project.yml are not additive [Feature] Change BigQuery labels to be additive instead of "clobber" Feb 10, 2024
@davidwitk
Copy link

davidwitk commented Feb 12, 2024

@dbeatty10 Given historic issues such as #893, this issue here, the discussion you mention on dbt Discourse, this seems to be a relevant issue for many community members. Even if this is not a bug and currently intended behavior, many seem to expect additive behavior, and it would make using labels much easier.

The proposed workarounds are not optimal:

  • Repeated labels: This workaround is not DRY and creates potentially lots of duplication
  • Post-hooks: Running so many post-hooks is not efficient and creates a lot of overhead

@Fleid Fleid self-assigned this Feb 14, 2024
@Fleid Fleid removed the refinement Product or leadership input needed label Feb 14, 2024
@iamtodor
Copy link

I feel the current one could be related to this one #1110

@Fleid Fleid removed their assignment Feb 22, 2024
Copy link
Contributor

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 26, 2024
@iamtodor
Copy link

Can we please not stale the issue?

@moseleyi
Copy link
Author

Yes, this is still very much valid feature I would like to see!

@github-actions github-actions bot removed the Stale label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants