Chore: export arrow dataframe utilities (#22016)

* export arrow dataframe

* use the same table
This commit is contained in:
Ryan McKinley 2020-02-08 09:50:35 +01:00 committed by GitHub
parent f48169633c
commit d0470409d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -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) {

View File

@ -4,6 +4,4 @@ export * from './CircularDataFrame';
export * from './MutableDataFrame';
export * from './processDataFrame';
export * from './dimensions';
// Phantom JS :(
//export * from './ArrowDataFrame';
export * from './ArrowDataFrame';