Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Russ Cam <[email protected]>
  • Loading branch information
Anush008 and russcam authored Jan 6, 2024
1 parent ecd3c7c commit 2754387
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/main/java/io/qdrant/client/QdrantClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2257,13 +2257,16 @@ public ListenableFuture<UpdateBatchResponse> batchUpdateAsync(
*
* @return a new instance of {@link ListenableFuture}
*/
public ListenableFuture<UpdateBatchResponse> batchUpdateAsync(UpdateBatchPoints request, @Nullable Duration timeout) {
public ListenableFuture<List<UpdateResult>> batchUpdateAsync(UpdateBatchPoints request, @Nullable Duration timeout) {
String collectionName = request.getCollectionName();
Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty");
logger.debug("Batch update points on '{}'", collectionName);
ListenableFuture<UpdateBatchResponse> future = getPoints(timeout).updateBatch(request);
addLogFailureCallback(future, "Batch update points");
return future;
return Futures.transform(
future,
UpdateBatchResponse::getResultList,
MoreExecutors.directExecutor());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/qdrant/client/VectorsFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private VectorsFactory() {
public static Vectors namedVectors(Map<String, Vector> values) {
return Vectors.newBuilder()
.setVectors(NamedVectors.newBuilder()
.putAllVectors(Maps.transformValues(values, v -> v))
.putAllVectors(values)
)
.build();
}
Expand Down

0 comments on commit 2754387

Please sign in to comment.