Transformers: Do not add transformation info to output frames (#81747)

This commit is contained in:
Ryan McKinley 2024-02-01 17:17:30 -08:00 committed by GitHub
parent 315d3a7a72
commit 9d17f6e6aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 3 additions and 36 deletions

View File

@ -55,19 +55,6 @@ const postProcessTransform =
return after; return after;
} }
// Add a key to the metadata if the data changed
for (const series of after) {
if (!series.meta) {
series.meta = {};
}
if (!series.meta.transformations) {
series.meta.transformations = [info.id];
} else {
series.meta.transformations = [...series.meta.transformations, info.id];
}
}
// Add back the filtered out frames // Add back the filtered out frames
if (matcher) { if (matcher) {
// keep the frame order the same // keep the frame order the same

View File

@ -109,11 +109,6 @@ describe('ensureColumns transformer', () => {
}, },
], ],
"length": 2, "length": 2,
"meta": {
"transformations": [
"ensureColumns",
],
},
} }
`); `);
}); });

View File

@ -54,9 +54,6 @@ export interface QueryResultMeta {
/** Meta Notices */ /** Meta Notices */
notices?: QueryResultMetaNotice[]; notices?: QueryResultMetaNotice[];
/** Used to track transformation ids that where part of the processing */
transformations?: string[];
/** Currently used to show results in Explore only in preferred visualisation option */ /** Currently used to show results in Explore only in preferred visualisation option */
preferredVisualisationType?: PreferredVisualisationType; preferredVisualisationType?: PreferredVisualisationType;

View File

@ -313,9 +313,6 @@ describe('Fields from JSON', () => {
}, },
], ],
length: 2, length: 2,
meta: {
transformations: ['sortBy'],
},
}; };
const frames = extractFieldsTransformer.transformer(extractConfig, ctx)([testDataFrame]); const frames = extractFieldsTransformer.transformer(extractConfig, ctx)([testDataFrame]);

View File

@ -109,10 +109,7 @@ export const StateTimelinePanel = ({
* Render nothing in this case to prevent error. * Render nothing in this case to prevent error.
* See https://github.com/grafana/support-escalations/issues/932 * See https://github.com/grafana/support-escalations/issues/932
*/ */
if ( if (alignedData.fields.length - 1 !== valueFieldsCount || !alignedData.fields[seriesIdx]) {
(!alignedData.meta?.transformations?.length && alignedData.fields.length - 1 !== valueFieldsCount) ||
!alignedData.fields[seriesIdx]
) {
return null; return null;
} }

View File

@ -68,10 +68,7 @@ export const StateTimelineTooltip2 = ({
* Render nothing in this case to prevent error. * Render nothing in this case to prevent error.
* See https://github.com/grafana/support-escalations/issues/932 * See https://github.com/grafana/support-escalations/issues/932
*/ */
if ( if (alignedData.fields.length - 1 !== valueFieldsCount || !alignedData.fields[seriesIdx]) {
(!alignedData.meta?.transformations?.length && alignedData.fields.length - 1 !== valueFieldsCount) ||
!alignedData.fields[seriesIdx]
) {
return null; return null;
} }

View File

@ -108,10 +108,7 @@ export const StatusHistoryPanel = ({
* Render nothing in this case to prevent error. * Render nothing in this case to prevent error.
* See https://github.com/grafana/support-escalations/issues/932 * See https://github.com/grafana/support-escalations/issues/932
*/ */
if ( if (alignedData.fields.length - 1 !== valueFieldsCount || !alignedData.fields[seriesIdx]) {
(!alignedData.meta?.transformations?.length && alignedData.fields.length - 1 !== valueFieldsCount) ||
!alignedData.fields[seriesIdx]
) {
return null; return null;
} }