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

Allow metrics in semantic layer filters #9773

Merged
merged 4 commits into from
Mar 22, 2024
Merged

Allow metrics in semantic layer filters #9773

merged 4 commits into from
Mar 22, 2024

Conversation

courtneyholcomb
Copy link
Contributor

@courtneyholcomb courtneyholcomb commented Mar 18, 2024

resolves #9804
resolves SL-1794

Description

Bump DSI version to get a new feature into core - allowing metrics in filters for metrics, measures, and saved queries. You can see the changes to DSI here. This change is purely additive.

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

@cla-bot cla-bot bot added the cla:yes label Mar 18, 2024
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.04%. Comparing base (b435e26) to head (7a99fe1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9773   +/-   ##
=======================================
  Coverage   88.04%   88.04%           
=======================================
  Files         178      178           
  Lines       22461    22461           
=======================================
  Hits        19776    19776           
  Misses       2685     2685           
Flag Coverage Δ
integration 85.42% <ø> (ø)
unit 61.73% <ø> (ø)

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

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

@courtneyholcomb courtneyholcomb changed the title Tests for metrics in filters Bump DSI + tests for metrics in filters Mar 19, 2024
@courtneyholcomb courtneyholcomb added Skip Changelog Skips GHA to check for changelog file and removed Skip Changelog Skips GHA to check for changelog file labels Mar 19, 2024
@courtneyholcomb courtneyholcomb added user docs [docs.getdbt.com] Needs better documentation and removed Skip Changelog Skips GHA to check for changelog file labels Mar 22, 2024
@courtneyholcomb courtneyholcomb changed the title Bump DSI + tests for metrics in filters Allow metrics in semantic layer filters Mar 22, 2024
@dbt-labs dbt-labs deleted a comment from github-actions bot Mar 22, 2024
@courtneyholcomb courtneyholcomb marked this pull request as ready for review March 22, 2024 17:32
@courtneyholcomb courtneyholcomb requested a review from a team as a code owner March 22, 2024 17:32
Copy link
Member

@emmyoop emmyoop left a comment

Choose a reason for hiding this comment

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

Question in why the version is getting bumped.

@@ -73,7 +73,7 @@
# Accept patches but avoid automatically updating past a set minor version range.
"dbt-extractor>=0.5.0,<=0.6",
"minimal-snowplow-tracker>=0.0.2,<0.1",
"dbt-semantic-interfaces>=0.5.0,<0.6",
"dbt-semantic-interfaces>=0.5.1,<0.6",
Copy link
Member

Choose a reason for hiding this comment

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

Is this not backwards compatible with 0.5.0? Should we be pinning a range here or a specific version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is backwards compatible! Basically, I want to ensure that this feature is available for all users on core 1.8 once that gets released. We could leave the existing version range, but it might cause confusion for users if they somehow end up on DSI 0.5.0 and wonder why this feature isn't available!

Copy link
Contributor

@QMalcolm QMalcolm Mar 22, 2024

Choose a reason for hiding this comment

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

In this case it looks like a feature was added in the patch version bump to 0.5.1 from 0.5.0, specifically a feature allowing metrics to be referenced in filter attributes of semantic layer objects. Arguably, this should have constituted a 0.6.0, but the release of 0.5.1 has already happened. This makes 0.5.1 not fully backwards compatible with 0.5.0 in that if someone were to specify a metric in a filter, parsing would break if 0.5.0 is the installed DSI version.

Copy link
Contributor

Choose a reason for hiding this comment

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

So we'll want to get this change in prior to the final release of core 1.8.0

Copy link
Member

Choose a reason for hiding this comment

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

Arguably, this should have constituted a 0.6.0, but the release of 0.5.1 has already happened.

This makes sense. As long as in future we try to follow semver more closely I'll ✅ this. Since 1.7 is on 0.4 anyways it's low risk.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just me over her conflating backwards compatibility with being a purely additive change - sorry for the confusion!
And yes @QMalcolm point taken - we can do some work on the SL side to clean up our OSS versioning story in the future 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the quick review - would one of y'all mind merging? I don't have permission.

@QMalcolm QMalcolm merged commit 8c8c628 into main Mar 22, 2024
58 checks passed
@QMalcolm QMalcolm deleted the court/metric-filters branch March 22, 2024 18:49
@FishtownBuildBot
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Allow metrics in semantic layer filters
4 participants