Skip to content

Commit

Permalink
[Inference API] Fix serialization for inference delete endpoint respo…
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhniebergall authored Jul 3, 2024
1 parent 17f1d64 commit 9087fc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/110431.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 110431
summary: "[Inference API] Fix serialization for inference delete endpoint response"
area: Machine Learning
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,19 @@ public Response(boolean acknowledged, Set<String> pipelineIds) {

public Response(StreamInput in) throws IOException {
super(in);
pipelineIds = in.readCollectionAsSet(StreamInput::readString);
if (in.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_ENHANCE_DELETE_ENDPOINT)) {
pipelineIds = in.readCollectionAsSet(StreamInput::readString);
} else {
pipelineIds = Set.of();
}
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeCollection(pipelineIds, StreamOutput::writeString);
if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_ENHANCE_DELETE_ENDPOINT)) {
out.writeCollection(pipelineIds, StreamOutput::writeString);
}
}

@Override
Expand Down

0 comments on commit 9087fc5

Please sign in to comment.