diff --git a/milvus/grpc/Data.ts b/milvus/grpc/Data.ts index 827d0ac4..17e16867 100644 --- a/milvus/grpc/Data.ts +++ b/milvus/grpc/Data.ts @@ -156,6 +156,7 @@ export class Data extends Collection { fieldMap.set(DEFAULT_DYNAMIC_FIELD, { name: DEFAULT_DYNAMIC_FIELD, type: 'JSON', + elementType: 'None', data: [], // value container }); } diff --git a/milvus/types/Response.ts b/milvus/types/Response.ts index e7ae4c44..6d877903 100644 --- a/milvus/types/Response.ts +++ b/milvus/types/Response.ts @@ -4,7 +4,8 @@ export enum ErrorCode { UNEXPECTED_ERROR = 'UnexpectedError', EMPTY_COLLECTION = 'EmptyCollection', UPSERT_AUTO_ID_TRUE = 'UpsertAutoIDTrue', - COLLECTION_NOT_EXISTS = 'CollectionNotExists' + COLLECTION_NOT_EXISTS = 'CollectionNotExists', + Illegal_Argument = 'IllegalArgument', // CONNECT_FAILED = "CONNECT_FAILED", // PERMISSION_DENIED = "PERMISSION_DENIED", // COLLECTION_NOT_EXISTS = "COLLECTION_NOT_EXISTS", diff --git a/test/Upsert.spec.ts b/test/Upsert.spec.ts index 42df04cd..6d0ede94 100644 --- a/test/Upsert.spec.ts +++ b/test/Upsert.spec.ts @@ -177,9 +177,7 @@ describe(`Upsert API`, () => { const res = await milvusClient.upsert(params); - console.log('res',vectorsData, res) - - expect(res.status.error_code).toEqual(ErrorCode.UPSERT_AUTO_ID_TRUE); + expect(res.status.error_code).toEqual(ErrorCode.Illegal_Argument); }); it(`Upsert Data on different scalar fields`, async () => { diff --git a/test/tools/data.ts b/test/tools/data.ts index 9d8eeae8..b1cfc913 100644 --- a/test/tools/data.ts +++ b/test/tools/data.ts @@ -125,7 +125,10 @@ export const genArray: DataGenerator = params => { }); }; +export const genNone: DataGenerator = () => 'none'; + export const dataGenMap: { [key in DataType]: DataGenerator } = { + [DataType.None]: genNone, [DataType.Bool]: genBool, [DataType.Int8]: genInt, [DataType.Int16]: genInt,