Skip to content

Commit

Permalink
[fix] hotfix for arrow saving / loading (#2943)
Browse files Browse the repository at this point in the history
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
  • Loading branch information
igorDykhta authored Jan 27, 2025
1 parent 4031451 commit 7356c5a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/schemas/src/dataset-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pick from 'lodash.pick';
import {console as globalConsole} from 'global/window';

import {DATASET_FORMATS} from '@kepler.gl/constants';
import {ProtoDataset, RGBColor, JsonObject} from '@kepler.gl/types';
import {KeplerTable} from '@kepler.gl/table';
import {VERSIONS} from './versions';
Expand Down Expand Up @@ -106,7 +107,15 @@ export class DatasetSchema extends Schema {
const datasetFlattened = dataset.dataContainer
? {
...dataset,
allData: dataset.dataContainer.flattenData()
allData: dataset.dataContainer.flattenData(),
// we use flattenData to save arrow tables,
// but once flattened it's not an arrow file anymore.
metadata: {
...dataset.metadata,
...(dataset.metadata.format === DATASET_FORMATS.arrow
? {format: DATASET_FORMATS.row}
: {})
}
}
: dataset;

Expand Down

0 comments on commit 7356c5a

Please sign in to comment.