Commit d0470409 by Ryan McKinley Committed by GitHub

Chore: export arrow dataframe utilities (#22016)

* export arrow dataframe

* use the same table
parent f4816963
...@@ -112,7 +112,13 @@ function toArrowVector(field: Field): ArrowVector { ...@@ -112,7 +112,13 @@ function toArrowVector(field: Field): ArrowVector {
} }
export function grafanaDataFrameToArrowTable(data: DataFrame): Table { 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 => { data.fields.map(field => {
const column = Column.new(field.name, toArrowVector(field)); const column = Column.new(field.name, toArrowVector(field));
if (field.labels) { if (field.labels) {
......
...@@ -4,6 +4,4 @@ export * from './CircularDataFrame'; ...@@ -4,6 +4,4 @@ export * from './CircularDataFrame';
export * from './MutableDataFrame'; export * from './MutableDataFrame';
export * from './processDataFrame'; export * from './processDataFrame';
export * from './dimensions'; export * from './dimensions';
export * from './ArrowDataFrame';
// Phantom JS :(
//export * from './ArrowDataFrame';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment