-
Notifications
You must be signed in to change notification settings - Fork 79
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 label, type, and SQL to metric docs #278
Conversation
@GtheSheep thanks so much for the contribution! I got some time to test this out and it looks like the metric name is actually what ends up in the metric label field. It's a head scratcher. I'm not seeing anything obvious in the code or the In the meantime I'm going to work to get the failing test that is not related to your change fixed up so that the tests will pass after you merge my (soon to come) changes in. |
@emmyoop ahh thanks, yeah that error looked a little confusing 😅 |
Yeah, that did it, if I set:
then choose to display node.Label, it shows the metric label correctly, though this is a bit hacky, and I don't know enough about this project to know what not overriding node.label with node.name might impact 😅 though if I remove the |
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.
The error in building should be resolved now if you pull in the latests from dbt-docs
into your fork.
I've requested one small tweak and then this should be good to merge in. Thanks for your work on it!
@@ -148,7 +148,6 @@ angular | |||
|
|||
// Add metrics back into nodes to make site logic work | |||
_.each(service.files.manifest.metrics, function(node) { | |||
node.label = node.name; |
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 actually has to stay here as node.label
is what is used in the DAG. Removing this line results in the metric label, as defined in the yaml file in the project, showing on the DAG instead of the metric name, as desired.
This is the result of a design choice to use label
on the DAG. I do not think it's necessary to rework all this logic for the name in this case. I would just change this to
// node.label is reserved for use in the DAG so redefine the label here so we can access it in metric.js before assinging the value os `node.name` to `node.label`
node.metric_label = node.label;
node.label = node.name;
And then making the equivalent change over in metric.js
of:
{
name: "Label",
value: $scope.metric.metric_label,
},
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 exactly the kind of thing I was worried about 😹 but yeah sure, will update 👌
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.
@GtheSheep don't update it yet! We're having a conversation literally right now about this. Will get back to you in 5 min!
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.
thank you!
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.
hey @GtheSheep - thanks very much for digging into this! @callum-mcdata and I did something similar in #285 -- I wish i had saw this PR first!!
We debated internally about showing the metric label instead of the metric name in the DAG viz (and in other parts of the UI). My thinking is that it's preferable to see the label (say: Average Revenue Per Customer
) instead of a less human-readable name (eg. arpc
). What do you think makes more sense / you'd prefer to see?
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.
hey @drewbanin - yeah I think it most cases it's probably preferable to see the label, even if that's not quite consistent with some of the other objects, but if it's just a styling choice with no other impacts it's probably nicer for general users, the only slight downside I can see is the lineage graph then not matching the selector at the bottom, but that seems minimal 🤷♂️
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.
happy to close this in favour of #285 😸
Closing in favor of #285 |
resolves #246
Description
Adds metric label, type, and SQL to their docs pages under the extra fields in details, not sure if that's the desired placement for the SQL though?
Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.