From f05638ba845596faef088efa3ee98686d26dad26 Mon Sep 17 00:00:00 2001 From: John Bodley <4567245+john-bodley@users.noreply.github.com> Date: Thu, 3 Aug 2023 05:33:03 -0700 Subject: [PATCH] fix(annotation): Address regression from #24694 (#24874) --- .../superset-ui-core/src/query/types/AnnotationLayer.ts | 3 +-- .../superset-ui-core/test/query/types/AnnotationLayer.test.ts | 1 - .../plugins/plugin-chart-echarts/test/utils/annotation.test.ts | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts b/superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts index bac743cb25..d5b2981163 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts @@ -159,7 +159,6 @@ export function isTableAnnotationLayer( } export type RecordAnnotationResult = { - columns: string[]; records: DataRecord[]; }; @@ -181,7 +180,7 @@ export function isTimeseriesAnnotationResult( export function isRecordAnnotationResult( result: any, ): result is RecordAnnotationResult { - return Array.isArray(result?.columns) && Array.isArray(result?.records); + return Array.isArray(result?.records); } export type AnnotationData = { [key: string]: AnnotationResult }; diff --git a/superset-frontend/packages/superset-ui-core/test/query/types/AnnotationLayer.test.ts b/superset-frontend/packages/superset-ui-core/test/query/types/AnnotationLayer.test.ts index c586239fd7..f6a695eb91 100644 --- a/superset-frontend/packages/superset-ui-core/test/query/types/AnnotationLayer.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/query/types/AnnotationLayer.test.ts @@ -93,7 +93,6 @@ describe('AnnotationLayer type guards', () => { }, ]; const recordAnnotationResult: RecordAnnotationResult = { - columns: ['col1', 'col2'], records: [ { a: 1, b: 2 }, { a: 2, b: 3 }, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/utils/annotation.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/utils/annotation.test.ts index bef98483be..59afebd736 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/utils/annotation.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/utils/annotation.test.ts @@ -130,7 +130,6 @@ describe('extractAnnotationLabels', () => { ]; const results: AnnotationData = { 'My Interval': { - columns: ['col'], records: [{ col: 1 }], }, 'My Line': [