Skip to content

Commit

Permalink
when key is null, skip running predict (opensearch-project#2402) (ope…
Browse files Browse the repository at this point in the history
…nsearch-project#2403)

(cherry picked from commit 950f864)

Co-authored-by: Mingshi Liu <[email protected]>
  • Loading branch information
2 people authored and dhrubo-os committed May 17, 2024
1 parent 78c8c1e commit 9854162
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 9854162

Please sign in to comment.