From 56ccc09b5db7fe81a6c1c18408db4e2fcbfe536a Mon Sep 17 00:00:00 2001 From: ryjiang Date: Fri, 20 Dec 2024 18:45:47 +0800 Subject: [PATCH] add coverage Signed-off-by: ryjiang --- milvus/utils/Format.ts | 6 +++++- test/utils/Format.spec.ts | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/milvus/utils/Format.ts b/milvus/utils/Format.ts index 7588074..5dbfc09 100644 --- a/milvus/utils/Format.ts +++ b/milvus/utils/Format.ts @@ -1122,6 +1122,10 @@ const convertArray = (arr: any[]): TemplateArrayValue => { } default: - throw new Error('Unsupported array type'); + return { + string_data: { + data: arr, + }, + }; } }; diff --git a/test/utils/Format.spec.ts b/test/utils/Format.spec.ts index 9c14efc..8010a08 100644 --- a/test/utils/Format.spec.ts +++ b/test/utils/Format.spec.ts @@ -1122,6 +1122,7 @@ describe('utils/format', () => { [7, 8], ], ], + defaultArr: [undefined, undefined], }; const formattedExprValues = formatExprValues(exprValues); @@ -1228,6 +1229,11 @@ describe('utils/format', () => { }, }, }, + defaultArr: { + array_val: { + string_data: { data: [undefined, undefined] }, + }, + }, }); }); });