Skip to content

Commit

Permalink
when key is null, skip running predict (#2402)
Browse files Browse the repository at this point in the history
(cherry picked from commit 950f864)
  • Loading branch information
mingshl authored and github-actions[bot] committed May 3, 2024
1 parent a732741 commit 6362062
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ public void testMLInferenceProcessorWithObjectFieldType() throws Exception {
String index_name = "daily_index";
createPipelineProcessor(createPipelineRequestBody, "diary_embedding_pipeline");
createIndex(index_name, createIndexRequestBody);
// Skip test if key is null
if (OPENAI_KEY == null) {
return;
}
uploadDocument(index_name, "1", uploadDocumentRequestBody);
Map document = getDocument(index_name, "1");
List embeddingList = JsonPath.parse(document).read("_source.diary_embedding");
Expand Down Expand Up @@ -194,6 +198,10 @@ public void testMLInferenceProcessorWithNestedFieldType() throws Exception {
String index_name = "book_index";
createPipelineProcessor(createPipelineRequestBody, "embedding_pipeline");
createIndex(index_name, createIndexRequestBody);
// Skip test if key is null
if (OPENAI_KEY == null) {
return;
}
uploadDocument(index_name, "1", uploadDocumentRequestBody);
Map document = getDocument(index_name, "1");

Expand Down

0 comments on commit 6362062

Please sign in to comment.