Skip to content
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 option to fill unavailable fields with null instead of failing with "Fields have different lengths" #303

Open
dpsenner opened this issue Aug 30, 2022 · 3 comments
Labels
type/feature-request Requested new feature or enhancement

Comments

@dpsenner
Copy link

It would be awesome if there was an option to enable fill unavailable fields with null. This way it would be possible to visualize data that contains variable fields. The background is, some Api implementers prefer to not send the key with value null if the value is unset. One possible usecase is effective bandwidth reduction.

@txjmb
Copy link

txjmb commented Sep 2, 2022

Some sort of time scaffolding function would work well. For instance, "scaffold to 5-second generated time series". You would then have options like "interpolate" leave null or whatever for missing values.

@bode689
Copy link

bode689 commented Oct 4, 2022

A nice feature of JSONata can mitigate your (and mine) problem. It performs an existance test for each entry and it is well managed by grafana.

$.doc.($exists(channel) ? channel : null)

You can also use it as something fancier like $.doc.(channel > 5 ? "great" : "bad")

Hope it helps. Btw, I massively use this feature and its verbosity bothers me quite a lot.
So any embedded option to automatically fill fields as you propose would be great.

@bijwaard
Copy link

bijwaard commented Sep 8, 2023

My JSON server has a parameter to limit the number of channels to return (rtd_len) and the number of datapoints (samples), currently I get an error when I configure less channels than provided in the fields specification, while the query result looks fine with rtd_len=3, samples=10:
image

With all specified fields (rtd_len=4), I do get all channels:
image

Ignoring empty fields by setting it them to null will certainly help to toggle showing last channel (Neutral current in my case).

Kind regards,
Dennis

@gabor gabor added the type/feature-request Requested new feature or enhancement label May 24, 2024
@gabor gabor moved this to Backlog in OSS Big Tent May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request Requested new feature or enhancement
Projects
Status: Backlog
Development

No branches or pull requests

5 participants