mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: export arrow dataframe utilities (#22016)
* export arrow dataframe * use the same table
This commit is contained in:
parent
f48169633c
commit
d0470409d6
@ -112,7 +112,13 @@ function toArrowVector(field: Field): ArrowVector {
|
||||
}
|
||||
|
||||
export function grafanaDataFrameToArrowTable(data: DataFrame): Table {
|
||||
const table = Table.new(
|
||||
// Return the original table
|
||||
let table = (data as any).table;
|
||||
if (table instanceof Table) {
|
||||
return table as Table;
|
||||
}
|
||||
|
||||
table = Table.new(
|
||||
data.fields.map(field => {
|
||||
const column = Column.new(field.name, toArrowVector(field));
|
||||
if (field.labels) {
|
||||
|
@ -4,6 +4,4 @@ export * from './CircularDataFrame';
|
||||
export * from './MutableDataFrame';
|
||||
export * from './processDataFrame';
|
||||
export * from './dimensions';
|
||||
|
||||
// Phantom JS :(
|
||||
//export * from './ArrowDataFrame';
|
||||
export * from './ArrowDataFrame';
|
||||
|
Loading…
Reference in New Issue
Block a user