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
Data: Add Numeric Kind constants, link to DP docs #560
Conversation
FrameTypeTable = "table" | ||
) | ||
// --- | ||
// Docs Note: Constants need to be on their own line for links to work with the pkgsite docs. |
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.
is there a way to preview the output?
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 run:
https://github.com/golang/pkgsite
# kbrandt @ kbrandt-ws in ~/go/github.com/grafana/grafana-plugin-sdk-go on git:frameTypeNumeric x [12:22:58] C:130
$ pkgsite -http localhost:9123 -gorepo .
and then my url is http://localhost:9123/github.com/grafana/grafana-plugin-sdk-go@v0.0.0/data
const FrameTypeTimeSeriesLong FrameType = "timeseries-long" | ||
|
||
// FrameTypeTimeSeriesMany is the same as "Wide" with exactly one numeric value field | ||
// Deprecated: use FrameTypeTimeSeriesMulti instead. |
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.
does Deprecated
need a line break above it to be recognized?
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.
Doesn't seem to help, but cleaner so will change anyways
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.
seems like it works with linting, but not pkgsite
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.
So it seems, need to make sure FE understands it first, will either wait a little bit after checking or move that particular one to another PR.
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.
Is this what you had asked me to work on @kylebrandt? Will this help with pkgsite? grafana/grafana#59070
FrameTypeTimeSeriesMulti, | ||
FrameTypeTimeSeriesMany, | ||
|
||
FrameTypeNumericWide, | ||
FrameTypeNumericLong, | ||
FrameTypeNumericMulti: | ||
return true | ||
} |
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.
FrameTypeDirectoryListing
, FrameTypeTable
are still considered UnknownTypes? It is still unclear where and how the IsKnownType
should be used.
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'm not sure on use for IsKnownType() either...
case p.IsTimeSeries(): | ||
return KindTimeSeries | ||
case p.IsNumeric(): | ||
return KindNumeric | ||
default: | ||
return KindUnknown | ||
} |
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.
same as previous comment. Don't we have kind for FrameTypeDirectoryListing
\ FrameTypeTable
?
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.
Good catch. I'm not sure what they should be. Going with Table, is seems we could say:
- Kind is Table
- Format is Table
- We abbreviate "TableTable" as "Table"
Could do the same for "directory-listing". I guess the assumption here is there will only ever be one format for the kind, but we could do "DirectoryListingSomething" or "TableSomething" if we have to someday. WDYT?
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'm also perhaps unsure about "Table" itself.
For example, with a SQL query like like Select Avg(foo), city group by city
, at least in SSE, it would be looking for "NumericLong", but the in the SQL query UI in grafana that would be format as "Table". And this also makes me realize the collision on the word "format" between the contract and UI.
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.
Moved these to #572 so can go forward with this PR for now.
What this PR does / why we need it:
Special notes for your reviewer:
Puts things in their own constant lines so the link documentation works with
pkgsite
(go package documentation).Didn't do heatmap yet, that could be another PR.