Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
(#4884) Add support for ratio metrics #5027
(#4884) Add support for ratio metrics #5027
Changes from 4 commits
72cad80
cf23d65
d43e859
8dcfeb1
aae1c81
4d4198c
a57d3b0
395393e
55e7ab7
a9e839e
3a8385b
db35e88
d6e886c
7af4c51
32c3c53
0344a20
bee3eea
934605e
06eb926
4461d7a
31cfa7f
60ef314
cd957a6
ba3a78c
54c38d0
7b03989
46679e2
b8a7f99
e235ab7
c28628f
68f7708
e808272
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we allow other yaml-only resources (like sources) to be disabled? If so, we should implement this part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sources can be disabled, exposures cannot (but we should support this). In the past, it's only been possible to disable a source via the
sources:
block indbt_project.yml
.In v1.1, we'll be adding the ability to disable a source inline with its definition (#5008):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was my take on a class analogous to the
Relation
object. I figured that this kind of object could be returned from themetric()
function. It would help us avoid the need to find the metric in thegraph
manually like we do hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets remove
.metric_value
based on conversation here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this return the metric name? Or the
sql
expression? Or something else? Not 100% sure yet....There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would the ResolvedMetricReference get stringified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would happen when you interpolate the results of the
metric()
function, so:would evaluate to
So - returning the name of the metric is kind of useless, but I am unsure if we want to return anything more sophisticated than that? I guess we could return
self.node.sql
instead (which feels reasonable), but this doesn't extend well to theratio
metric type which does not have a.sql
valueSo, uh, short answer: you probably wouldn't stringify it in practice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we shouldn't even have a str method then? With the idea that it's better to fail noisily than fail silently.