From e88f9ce18cb5d2e3f368a279af0928834d9561d7 Mon Sep 17 00:00:00 2001 From: Ib Green Date: Fri, 18 Oct 2024 16:27:46 -0400 Subject: [PATCH] fix --- .../src/lib/table/batch-builder/arrow-table-builder.ts | 4 ++-- modules/shapefile/test/dbf-arrow-loader.spec.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) 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);