Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
wip (#2381)
Xun Lidf1397fd2f4a
diff --git a/src/utils/src/dataset-utils.ts b/src/utils/src/dataset-utils.tsindex 53e8d9481..44cc65ca9 100644--- a/src/utils/src/dataset-utils.ts+++ b/src/utils/src/dataset-utils.ts@@ -467,8 +467,12 @@ export function getFieldsFromData(data: RowData, fieldOrder: string[]): Field[]const name = fieldByIndex[index];const fieldMeta = metadata.find(m => m.key === field);- let type = fieldMeta.type;- const format = fieldMeta.format;++ // fieldMeta could be undefined if the field has no data and Analyzer.computeColMeta+ // will dump the field. In this case, we will simply assign the field type to STRING+ // since dropping the column in the RowData could be expensive+ let type = fieldMeta?.type || 'STRING';+ const format = fieldMeta?.format || '';// check if string is hex wkbif (type === AnalyzerDATA_TYPES.STRING) {diff --git a/test/node/utils/data-processor-test.js b/test/node/utils/data-processor-test.jsindex 86ac98247..555b99c29 100644--- a/test/node/utils/data-processor-test.js+++ b/test/node/utils/data-processor-test.js@@ -70,6 +70,7 @@ test('Processor -> getFieldsFromData', t => {trip_epoch: '1472688000000',time_str: 'January 1st 2017 11:00pm ',value: '4',+ novalue: null,surge: '1.2',isTrip: 'true',zeroOnes: '0',@@ -82,6 +83,7 @@ test('Processor -> getFieldsFromData', t => {trip_epoch: '1472860800000',time_str: 'January 1st 2017 11:01pm ',value: '3',+ novalue: null,surge: null,isTrip: 'false',zeroOnes: '1',@@ -96,6 +98,7 @@ test('Processor -> getFieldsFromData', t => {trip_epoch: null,time_str: 'January 1st, 2017 11:02pm ',value: '2',+ novalue: null,surge: '1.3',isTrip: null,zeroOnes: '1',@@ -110,6 +113,7 @@ test('Processor -> getFieldsFromData', t => {trip_epoch: null,time_str: 'January 1st, 2017 11:02pm ',value: '0',+ novalue: null,surge: '1.4',isTrip: null,zeroOnes: '0',@@ -128,6 +132,7 @@ test('Processor -> getFieldsFromData', t => {'timestamp','timestamp','integer',+ 'string','real','boolean','integer',