QueryData: Support JSON format response#1491
Merged
Conversation
ryantxu
commented
Feb 21, 2026
| // It will set the RefID on the frames to the RefID key in Responses if a Frame's | ||
| // RefId property is an empty string. | ||
| func (t ConvertToProtobuf) QueryDataResponse(res *QueryDataResponse) (*pluginv2.QueryDataResponse, error) { | ||
| func (t ConvertToProtobuf) QueryDataResponse(format DataFrameFormat, res *QueryDataResponse) (*pluginv2.QueryDataResponse, error) { |
Contributor
Author
There was a problem hiding this comment.
this is a breaking change!
We could avoid it by adding a new function and defaulting to arrow -- but this is kind of internal, and if anyone is calling it directly we would like them to consider the new request parameter also 😏
Member
There was a problem hiding this comment.
one option to avoid breaking changes might be to make this optional by moving to the second arg and using ...DataFrameFormat. that always feels a bit sketchy to me though. thoughts?
Member
There was a problem hiding this comment.
scratch that, @wbrowne mentioned in slack that it's only used in the SDK, which i missed
dgiagio
reviewed
Feb 23, 2026
ryantxu
commented
Feb 24, 2026
| return | ||
| } | ||
|
|
||
| respJSON, err := tpQueryData.Client.QueryData(ctx, &backend.QueryDataRequest{ |
Contributor
Author
There was a problem hiding this comment.
ensures that the JSON response format matches the otheres
toddtreece
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Similar to #1486, this allows clients to request JSON bytes from QueryData
This includes a breaking change inside the internal ConvertToProtobuf utility. Given that this is an internal utility marked:
In grafana/grafana#118223, this will allow every datasource to efficiently implement direct-to-browser chunking without changing any code