mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 17:43:35 -06:00
DataFormats: When transforming TableModel -> DataFrame -> Table preserve the type attribute (#19621)
This commit is contained in:
parent
6f0faa595b
commit
99c1c16a04
@ -124,11 +124,13 @@ describe('SerisData backwards compatibility', () => {
|
||||
const table = {
|
||||
columns: [],
|
||||
rows: [],
|
||||
type: 'table',
|
||||
};
|
||||
|
||||
const series = toDataFrame(table);
|
||||
const roundtrip = toLegacyResponseData(series) as TableData;
|
||||
expect(roundtrip.columns.length).toBe(0);
|
||||
expect(roundtrip.type).toBe('table');
|
||||
});
|
||||
|
||||
it('converts TableData to series and back again', () => {
|
||||
|
@ -299,6 +299,7 @@ export const toLegacyResponseData = (frame: DataFrame): TimeSeries | TableData =
|
||||
}
|
||||
return { text: name };
|
||||
}),
|
||||
type: 'table',
|
||||
refId: frame.refId,
|
||||
meta: frame.meta,
|
||||
rows,
|
||||
|
@ -47,6 +47,7 @@ export interface TableData extends QueryResultBase {
|
||||
name?: string;
|
||||
columns: Column[];
|
||||
rows: any[][];
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export type TimeSeriesValue = number | null;
|
||||
|
Loading…
Reference in New Issue
Block a user