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

Add support for creating bigquery labels from meta #890

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

physcat
Copy link

@physcat physcat commented Mar 7, 2025

Introduces a new feature flag, labels_from_meta, that allows adding labels from the meta config into labels. If enabled, meta labels are included alongside existing labels, with labels taking priority in case of conflicts.
Default behavior remains unchanged unless the flag is explicitly set.

resolves #889
docs dbt-labs/docs.getdbt.com/#

Problem

Currently, users can add BigQuery labels through the explicit labels configuration, but there's no way to leverage existing metadata in the meta field as labels. This creates duplicate work when users want to expose the same information in both places.

Solution

Implemented a new labels_from_meta configuration flag that, when enabled, merges items from the meta section with the labels configuration. This allows users to maintain a single source of information while still controlling which metadata is exposed as BigQuery labels.

Key implementation details:

  • Default behavior remains unchanged (backward compatible)
  • When enabled, meta values are included alongside existing labels
  • In case of conflicts, labels entries take precedence

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@physcat physcat requested a review from a team as a code owner March 7, 2025 16:25
Copy link

cla-bot bot commented Mar 7, 2025

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @physcat

Copy link
Contributor

github-actions bot commented Mar 7, 2025

Thank you for your pull request! We could not find a changelog entry for this change in the dbt-bigquery package. For details on how to document a change, see the Contributing Guide.

@physcat physcat force-pushed the labels_from_meta branch from acce81b to 6489e82 Compare March 7, 2025 16:49
@cla-bot cla-bot bot added the cla:yes The PR author has signed the CLA label Mar 7, 2025
Implements labels_from_meta flag to include meta config items as BigQuery
labels. When enabled, meta items are merged with existing labels, with
labels taking priority for conflicts. Default behavior remains unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes The PR author has signed the CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Add support for creating BigQuery labels from meta configuration
1 participant