diff --git a/examples/demo-app/src/reducers/index.js b/examples/demo-app/src/reducers/index.js index e44350ffe3..fdacad337d 100644 --- a/examples/demo-app/src/reducers/index.js +++ b/examples/demo-app/src/reducers/index.js @@ -96,6 +96,7 @@ export const loadRemoteResourceSuccess = (state, action) => { let unprocessedData = action.response; if (shape === 'arrow-table') { processorMethod = processArrowTable; + unprocessedData = action.response.data; } else if (shape === 'object-row-table') { processorMethod = processRowObject; unprocessedData = action.response.data; diff --git a/src/processors/src/data-processor.ts b/src/processors/src/data-processor.ts index c3346ce130..1e8abc2fbb 100644 --- a/src/processors/src/data-processor.ts +++ b/src/processors/src/data-processor.ts @@ -5,7 +5,6 @@ import * as arrow from 'apache-arrow'; import {csvParseRows} from 'd3-dsv'; import {DATA_TYPES as AnalyzerDATA_TYPES} from 'type-analyzer'; import normalize from '@mapbox/geojson-normalize'; -import {ArrowTable} from '@loaders.gl/schema'; import {ALL_FIELD_TYPES, DATASET_FORMATS, GUIDES_FILE_FORMAT_DOC} from '@kepler.gl/constants'; import {ProcessorResult, Field} from '@kepler.gl/types'; import { @@ -382,8 +381,8 @@ export function processKeplerglDataset( * @param arrowTable ArrowTable to parse, see loaders.gl/schema * @returns dataset containing `fields` and `rows` or null */ -export function processArrowTable(arrowTable: ArrowTable): ProcessorResult | null { - return processArrowBatches(arrowTable.data.batches); +export function processArrowTable(arrowTable: arrow.Table): ProcessorResult | null { + return processArrowBatches(arrowTable.batches); } /** diff --git a/src/reducers/src/vis-state-selectors.ts b/src/reducers/src/vis-state-selectors.ts index 7f2c53c423..228bdce74b 100644 --- a/src/reducers/src/vis-state-selectors.ts +++ b/src/reducers/src/vis-state-selectors.ts @@ -8,13 +8,13 @@ const DEFAULT_FILE_EXTENSIONS = ['csv', 'json', 'geojson', 'arrow']; const DEFAULT_FILE_FORMATS = ['CSV', 'Json', 'GeoJSON', 'Arrow']; export const getFileFormatNames = createSelector( - // @ts-expect-error state => state.loaders, + // @ts-ignore loaders is unknonwn type loaders => [...DEFAULT_FILE_FORMATS, ...loaders.map(loader => loader.name)] ); export const getFileExtensions = createSelector( - // @ts-expect-error state => state.loaders, + // @ts-ignore loaders is unknonwn type loaders => [...DEFAULT_FILE_EXTENSIONS, ...loaders.flatMap(loader => loader.extensions)] );