grafana-plugin-sdk-go
grafana-plugin-sdk-go copied to clipboard
[UNMERGABLE] Add Arrow Duration support to Frame
This PR ostensibly adds support for the Arrow Duration
type to the set of types that the SDK can convert into data frames.
Unfortunately it's not currently mergeable because it appears that the front-end doesn't support the Arrow Duration
type:
t=2022-01-17T21:46:41+0000 lvl=eror msg="Metric request error" logger=context userId=1 orgId=1 uname=admin error="failed to query data: unsupported conversion from arrow to sdk type for arrow type DURATION" remote_addr=[::1]
This is one of those times you just start hacking on something and only find out about previous impediments halfway through :-) 👋 @kylebrandt https://github.com/grafana/grafana-plugin-sdk-go/pull/155
The code in the PR taken in isolation should be considered completed. I've updated the golden files and added a fair amount of test coverage.
Looks like there isn't much that can be done until https://issues.apache.org/jira/browse/ARROW-5356 gets resolved (if it ever does??)
I suppose one option might be to tweak this PR so that the Arrow columns type returned from the back-end is handled and then converted into another (supported) type for the front-end. Perhaps a duration formatted string? Let me know if that's of interest - cheers.
I suppose one option might be to tweak this PR so that the Arrow columns type returned from the back-end is handled and then converted into another (supported) type for the front-end. Perhaps a duration formatted string? Let me know if that's of interest - cheers.
On second thought that would be better handled by the front-end. Perhaps converting them to Int64 arrays for the front-end might be worthwhile?
Looks like there isn't much that can be done until https://issues.apache.org/jira/browse/ARROW-5356 gets resolved (if it ever does??)
we don't use Arrow.js in the frontend anymore [0] [1], so that's probably not too relevant.
[0] https://github.com/grafana/grafana/pull/31010 [1] https://github.com/grafana/grafana/pull/32575
Thanks @leeoniya. Who might best know the state of Duration support on the front-end? Or perhaps I'm running into a bug elsewhere?
AFAIK, these are the only types supported on the front-end currently:
https://github.com/grafana/grafana/blob/2048060df0439963a9d183629fd8d764edf67ae6/packages/grafana-data/src/types/dataFrame.ts#L10-L20
cc @ryantxu
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.