Timeseries to table transformation: Fix misaligned table field values if some frames are missing a label #78909
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.
Hey!
Found a bug with converting frame labels to fields in time series table transform.
When coverting time series frames to a "table" frame, a field is created for each label and filled with label value from each frame. However if some frame in the middle is missing a particular label, transform would just skipt it and not add an empty value. Thus field values would become misaligned with other fields.
For example if all frames have
name
label but only some frames havenamespace
label, in the resulting table namespaces would become misattributed to wrong names. Names coming from frames with missing namespace would get attributed namespace from the next frame that has one.It's probably best to look at the added test to quickly grok the issue :)