Skip to content

Commit

Permalink
deleteIds Marked as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
lentitude2tk committed Oct 23, 2023
1 parent d1866d9 commit 57dbcb4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/main/java/io/milvus/client/AbstractMilvusGrpcClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2972,9 +2972,8 @@ public R<DeleteResponse> delete(DeleteIdsParam requestParam) {
.withCollectionName(requestParam.getCollectionName())
.withExpr(expr)
.build();
R<MutationResult> resultR = delete(deleteParam);
MutationResultWrapper resultWrapper = new MutationResultWrapper(resultR.getData());
return R.success(DeleteResponse.builder().deleteIds(resultWrapper.getInsertIDs()).build());
delete(deleteParam);
return R.success(DeleteResponse.builder().deleteIds(Lists.newArrayList()).build());
} catch (StatusRuntimeException e) {
logError("Delete RPC failed! Collection name:{}",
requestParam.getCollectionName(), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@
@Getter
@ToString
public class DeleteResponse {
/**
* In the new version, this method only returns an empty list and does not return specific values
* Mark is as deprecated, keep it to compatible with the legacy code
*/
@Deprecated
public List<?> deleteIds;
}
1 change: 0 additions & 1 deletion src/test/java/io/milvus/client/MilvusClientDockerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2107,6 +2107,5 @@ private static void testHighLevelDelete(String collectionName, List primaryIds)
String outPutStr = String.format("collectionName:%s, primaryIds:%s, deleteResponseR:%s", collectionName, primaryIds, deleteResponseR);
System.out.println(outPutStr);
Assertions.assertEquals(R.Status.Success.getCode(), deleteResponseR.getStatus().intValue());
Assertions.assertEquals(primaryIds.size(), deleteResponseR.getData().getDeleteIds().size());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ public void delete() {
.withPrimaryIds(integers)
.build());
Assert.assertEquals(delete.getStatus().intValue(), R.Status.Success.getCode());
Assert.assertEquals(delete.getData().getDeleteIds().size(), integers.size());
}

@Severity(SeverityLevel.BLOCKER)
Expand Down Expand Up @@ -240,7 +239,6 @@ public void deleteVarcharPKData() {
.withPrimaryIds(pks)
.build());
Assert.assertEquals(delete.getStatus().intValue(), R.Status.Success.getCode());
Assert.assertEquals(delete.getData().getDeleteIds().size(), pks.size());
}


Expand Down

0 comments on commit 57dbcb4

Please sign in to comment.