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

Support labels for semantic_models, dimensions, measures and entities #8646

Merged
merged 5 commits into from
Sep 22, 2023

Conversation

emmyoop
Copy link
Member

@emmyoop emmyoop commented Sep 13, 2023

resolves #8595

Problem

While label is required for Metric nodes, it is not currently supported for SemanticModel nodes, Dimensions, Entities and Measures.

Solution

Add support for an optional label field.

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

@cla-bot cla-bot bot added the cla:yes label Sep 13, 2023
@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@emmyoop emmyoop changed the title first pass Support labels for semantic_models, dimensions, measures and entities Sep 13, 2023
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.05% 🎉

Comparison is base (8aaed0e) 86.56% compared to head (cb715d3) 86.61%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8646      +/-   ##
==========================================
+ Coverage   86.56%   86.61%   +0.05%     
==========================================
  Files         175      175              
  Lines       25595    25604       +9     
==========================================
+ Hits        22156    22177      +21     
+ Misses       3439     3427      -12     
Flag Coverage Δ
integration 83.46% <100.00%> (+0.11%) ⬆️
unit 65.13% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
core/dbt/parser/schema_yaml_readers.py 91.91% <ø> (ø)
core/dbt/contracts/graph/nodes.py 96.13% <100.00%> (+<0.01%) ⬆️
core/dbt/contracts/graph/semantic_models.py 98.85% <100.00%> (+0.04%) ⬆️
core/dbt/contracts/graph/unparsed.py 93.48% <100.00%> (+0.05%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@emmyoop emmyoop marked this pull request as ready for review September 19, 2023 16:24
@emmyoop emmyoop requested a review from a team as a code owner September 19, 2023 16:24
@emmyoop emmyoop requested review from aranke and QMalcolm September 19, 2023 16:24
@jtcohen6 jtcohen6 added the user docs [docs.getdbt.com] Needs better documentation label Sep 20, 2023
Copy link
Contributor

@QMalcolm QMalcolm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

For anyone wondering, we can't test against the protocol yet for labels because dbt-semantic-interfaces hasn't released a version with them yet 🙃

@emmyoop emmyoop merged commit e3dfb09 into main Sep 22, 2023
55 checks passed
@emmyoop emmyoop deleted the er/8595-sl-labels branch September 22, 2023 15:56
@FishtownBuildBot
Copy link
Collaborator

Opened a new issue in dbt-labs/docs.getdbt.com: dbt-labs/docs.getdbt.com#4114

@github-actions
Copy link
Contributor

The backport to 1.6.latest failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.6.latest 1.6.latest
# Navigate to the new working tree
cd .worktrees/backport-1.6.latest
# Create a new branch
git switch --create backport-8646-to-1.6.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e3dfb09b10f3027dde473af3352c36f0e16e92a8
# Push it to GitHub
git push --set-upstream origin backport-8646-to-1.6.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.6.latest

Then, create a pull request where the base branch is 1.6.latest and the compare/head branch is backport-8646-to-1.6.latest.

aranke pushed a commit that referenced this pull request Sep 27, 2023
aranke added a commit that referenced this pull request Sep 27, 2023
@emmyoop emmyoop mentioned this pull request Sep 30, 2023
5 tasks
QMalcolm pushed a commit that referenced this pull request Oct 9, 2023
…#8646)

* first pass

* changelog

* changelog

* Delete .changes/unreleased/Features-20230913-155802.yaml

* Update .changes/unreleased/Features-20230914-074429.yaml
@aranke aranke mentioned this pull request Jul 12, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.6.latest cla:yes user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-3092] Support optional label property for semantic layer objects
5 participants