mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
parent
cfadbeb353
commit
f05638ba84
@ -159,7 +159,6 @@ export function isTableAnnotationLayer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type RecordAnnotationResult = {
|
export type RecordAnnotationResult = {
|
||||||
columns: string[];
|
|
||||||
records: DataRecord[];
|
records: DataRecord[];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -181,7 +180,7 @@ export function isTimeseriesAnnotationResult(
|
|||||||
export function isRecordAnnotationResult(
|
export function isRecordAnnotationResult(
|
||||||
result: any,
|
result: any,
|
||||||
): result is RecordAnnotationResult {
|
): result is RecordAnnotationResult {
|
||||||
return Array.isArray(result?.columns) && Array.isArray(result?.records);
|
return Array.isArray(result?.records);
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AnnotationData = { [key: string]: AnnotationResult };
|
export type AnnotationData = { [key: string]: AnnotationResult };
|
||||||
|
@ -93,7 +93,6 @@ describe('AnnotationLayer type guards', () => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
const recordAnnotationResult: RecordAnnotationResult = {
|
const recordAnnotationResult: RecordAnnotationResult = {
|
||||||
columns: ['col1', 'col2'],
|
|
||||||
records: [
|
records: [
|
||||||
{ a: 1, b: 2 },
|
{ a: 1, b: 2 },
|
||||||
{ a: 2, b: 3 },
|
{ a: 2, b: 3 },
|
||||||
|
@ -130,7 +130,6 @@ describe('extractAnnotationLabels', () => {
|
|||||||
];
|
];
|
||||||
const results: AnnotationData = {
|
const results: AnnotationData = {
|
||||||
'My Interval': {
|
'My Interval': {
|
||||||
columns: ['col'],
|
|
||||||
records: [{ col: 1 }],
|
records: [{ col: 1 }],
|
||||||
},
|
},
|
||||||
'My Line': [
|
'My Line': [
|
||||||
|
Loading…
Reference in New Issue
Block a user