-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
Transformations: Use an explicit join seperator when converting from an array to string field #80169
Conversation
packages/grafana-data/src/transformations/transformers/reduce.ts
Outdated
Show resolved
Hide resolved
@@ -224,6 +224,7 @@ export function reduceFields(data: DataFrame[], matcher: FieldMatcher, reducerId | |||
const value = results[reducer]; | |||
const copy = { | |||
...field, | |||
type: guessFieldTypeFromValue(value), |
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.
matches the behavior we have in reduceSeriesToRows(...)
rather than always keeping the same type!
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.
Looked though and other than a minor nit looks good. Tested out and appears to be working fine as well 😄
<> | ||
{(c.joinWith?.length || targetField?.type === FieldType.other) && ( | ||
<InlineField label="Join with" tooltip="Use an explicit separator when joining array values"> | ||
<Input value={c.joinWith} placeholder={'json'} onChange={onJoinWithChange(idx)} width={9} /> |
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.
JSON I believe is all caps.
…an array to string field (#80169)
This PR allows people more control over the object > string conversion function. Currently it is just JSON encoded, this PR allows specifying an explicit separator for arrays.
Panel debug snapshot dashboard