Skip to content

Commit

Permalink
fix dynamic field
Browse files Browse the repository at this point in the history
Signed-off-by: ruiyi.jiang <[email protected]>
  • Loading branch information
shanghaikid committed Oct 9, 2023
1 parent 6e67cf3 commit 58bc6fd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions milvus/grpc/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}
Expand Down
3 changes: 2 additions & 1 deletion milvus/types/Response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions test/Upsert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
3 changes: 3 additions & 0 deletions test/tools/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 58bc6fd

Please sign in to comment.