DataFrame processing: Require table rows to be array (#20357)
(cherry picked from commit 4260cd548f)
This commit is contained in:
committed by
Kyle Brandt
parent
0773ae80ea
commit
a8f13bb0c1
@@ -1,7 +1,5 @@
|
||||
// Libraries
|
||||
import isNumber from 'lodash/isNumber';
|
||||
import isString from 'lodash/isString';
|
||||
import isBoolean from 'lodash/isBoolean';
|
||||
import { isArray, isBoolean, isNumber, isString } from 'lodash';
|
||||
|
||||
// Types
|
||||
import {
|
||||
@@ -34,6 +32,10 @@ function convertTableToDataFrame(table: TableData): DataFrame {
|
||||
};
|
||||
});
|
||||
|
||||
if (!isArray(table.rows)) {
|
||||
throw new Error(`Expected table rows to be array, got ${typeof table.rows}.`);
|
||||
}
|
||||
|
||||
for (const row of table.rows) {
|
||||
for (let i = 0; i < fields.length; i++) {
|
||||
fields[i].values.buffer.push(row[i]);
|
||||
|
||||
Reference in New Issue
Block a user