Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen committed Oct 18, 2024
1 parent 74cdc15 commit e88f9ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ export class ArrowTableBuilder {
_getArrowRecordBatch(): arrow.RecordBatch {
const {arrowBuilders, arrowSchema} = this;
const arrowDatas = arrowBuilders.map((builder) => builder.flush());

const length = arrowDatas[0].length;
const structField = new arrow.Struct(arrowSchema.fields);
const arrowStructData = new arrow.Data(structField, 0, arrowDatas[0].length, 0, undefined, arrowDatas);
const arrowStructData = new arrow.Data(structField, 0, length, 0, undefined, arrowDatas);
const arrowRecordBatch = new arrow.RecordBatch(arrowSchema, arrowStructData);
return arrowRecordBatch;
}
Expand Down
3 changes: 1 addition & 2 deletions modules/shapefile/test/dbf-arrow-loader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const SHAPEFILE_JS_TEST_FILES = [
'utf8-property'
];

test.only('Shapefile Arrow DBF tests', async (t) => {
test('Shapefile Arrow DBF tests', async (t) => {
for (const testFileName of SHAPEFILE_JS_TEST_FILES) {
const encoding = testFileName === 'latin1-property' ? 'latin1' : 'utf8';
const options = {worker: false, dbf: {encoding}};
Expand All @@ -40,7 +40,6 @@ test.only('Shapefile Arrow DBF tests', async (t) => {

const table = await parse(body, DBFArrowLoader, options);

debugger
for (let i = 0; i < features.length; i++) {
const row = table.data.get(i)!.toJSON();
t.deepEqual(row, features[i].properties, testFileName);
Expand Down

0 comments on commit e88f9ce

Please sign in to comment.