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

BigQuery Label Accumulation #105

Closed
Fraser-Isbester opened this issue Jan 20, 2022 · 6 comments
Closed

BigQuery Label Accumulation #105

Fraser-Isbester opened this issue Jan 20, 2022 · 6 comments
Assignees
Labels
Stale type:enhancement New feature or request

Comments

@Fraser-Isbester
Copy link

Describe the feature

BigQuery labels do not accumulate hierarchically unlike most other configurations in dbt.

Describe alternatives you've considered

You could simply duplicate every collection of labels/tags into the most-nested part of the dbt_project (or within the model config). But that's not really clean/sustainable.

Additional context

None really.

Who will this benefit?

Any org that uses BigQuery and not everyone interfaces directly with DBT.

Are you interested in contributing this feature?

Sure! I am a python developer but don't specifically know how the graph building/hierarchy works but if this is deemed a good first ticket I will gladly take it on.

@McKnight-42 McKnight-42 self-assigned this Jan 25, 2022
@McKnight-42
Copy link
Contributor

@Fraser-Isbester Thank you for bringing up this issue, seems to be a issue with the default MergeBehavior of the dbt-bigquery BigqueryConfig, anddbt-core MergeBehavior.

This issue raises the questions of :

  • Can we define the adapter configs with non MergeBehavior
  • Can we provide a way for users to override default MergeBehavior

I will continue to give any direction towards a possible solution as we discuss them @jtcohen6 custom merge behavior for configs has already been putting a bit of thought into this towards syntax behaviors we could or have tried.

@McKnight-42
Copy link
Contributor

Also going to open up an issue in dbt-core which will continue some wide reaching possible solution discussions.

@slve
Copy link

slve commented Jul 23, 2022

Hi, I actually just faced the same issue this week.
I can confirm that labels from different config levels aren't aggregated.
For example if I add labels into an embedded config in a model (.sql),
then dbt will ignore the additional labels in the dataset's labels config in dbt_project.yml.

   dbt --version
Core:
  - installed: 1.1.1
  - latest:    1.1.1 - Up to date!

Plugins:
  - bigquery: 1.1.1 - Up to date!

@Fleid
Copy link
Contributor

Fleid commented Dec 7, 2022

Tying this one with dbt-labs/dbt-core#5236

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

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 remove the stale label or comment on the issue, or it will be closed in 7 days.

@dwradcliffe
Copy link

This is very frustrating as someone trying to apply labels at various layers across many projects and datasets. The current way of doing this is unsustainable and although there are workarounds it would be much nicer to support this properly out of the box.

Here is my current workaround:

macros/labels.sql

{% macro labels(new_labels) %}
  {{ model.config.get('labels').update(new_labels) | default("", true) }}
{% endmacro %}

models/model.sql

{{
  labels({
    'foo': 'bar'
  })
}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants