diff --git a/modules/schema-utils/src/lib/table/batch-builder/arrow-table-builder.ts b/modules/schema-utils/src/lib/table/batch-builder/arrow-table-builder.ts index 90376f46cc..56ed2a0d2f 100644 --- a/modules/schema-utils/src/lib/table/batch-builder/arrow-table-builder.ts +++ b/modules/schema-utils/src/lib/table/batch-builder/arrow-table-builder.ts @@ -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; } diff --git a/modules/shapefile/test/dbf-arrow-loader.spec.ts b/modules/shapefile/test/dbf-arrow-loader.spec.ts index bf3271361b..5173da30c4 100644 --- a/modules/shapefile/test/dbf-arrow-loader.spec.ts +++ b/modules/shapefile/test/dbf-arrow-loader.spec.ts @@ -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}}; @@ -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);