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

Fix tag: selection for projects with semantic models #8750

Merged
merged 3 commits into from
Sep 29, 2023
Merged

Conversation

jtcohen6
Copy link
Contributor

@jtcohen6 jtcohen6 commented Sep 29, 2023

resolves #8749

Problem

In projects with semantic models, tag: selection started failing with the release of v1.6.4

Solution

Add more defensive code around tag: selection. Previously, this method assumed that all graph-selectable resources have a tags attribute, but semantic models do not (yet).

Rather than backporting an addition of tags to semantic models, we would rather backport more defensive code.

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
  • This PR includes type annotations for new and modified functions

@jtcohen6 jtcohen6 requested a review from a team as a code owner September 29, 2023 15:52
@cla-bot cla-bot bot added the cla:yes label Sep 29, 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.

@jtcohen6 jtcohen6 requested a review from QMalcolm September 29, 2023 15:53
@cla-bot cla-bot bot added the cla:yes label Sep 29, 2023
@jtcohen6 jtcohen6 changed the title Fix tag: selection for semantic models Fix tag: selection for projects with semantic models Sep 29, 2023
@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (416bc84) 86.62% compared to head (d72cdce) 84.11%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8750      +/-   ##
==========================================
- Coverage   86.62%   84.11%   -2.51%     
==========================================
  Files         176      176              
  Lines       25772    25772              
==========================================
- Hits        22325    21679     -646     
- Misses       3447     4093     +646     
Flag Coverage Δ
integration 80.16% <100.00%> (-3.23%) ⬇️
unit 65.13% <100.00%> (ø)

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

Files Coverage Δ
core/dbt/graph/selector_methods.py 90.13% <100.00%> (-0.90%) ⬇️

... and 55 files with indirect coverage changes

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

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 🚀 I double checked that without the fix in selector_methods.py the added test failed, and it did. Then it stopped failing once the fix in selector_methods.py was present. WOOOOOOOO

@QMalcolm QMalcolm merged commit 48c97e8 into main Sep 29, 2023
54 of 55 checks passed
@QMalcolm QMalcolm deleted the jerco/fix-8749 branch September 29, 2023 16:49
github-actions bot pushed a commit that referenced this pull request Sep 29, 2023
* Add unit test to repro regression

* Add defensive code for tag: selection

* Add changelog entry

(cherry picked from commit 48c97e8)
QMalcolm pushed a commit that referenced this pull request Oct 2, 2023
* Add unit test to repro regression

* Add defensive code for tag: selection

* Add changelog entry

(cherry picked from commit 48c97e8)

Co-authored-by: Jeremy Cohen <[email protected]>
QMalcolm pushed a commit that referenced this pull request Oct 9, 2023
* Add unit test to repro regression

* Add defensive code for tag: selection

* Add changelog entry
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-3172] [Regression] tag: selection raises error if project has semantic models defined
2 participants