Skip to content

Commit

Permalink
when key is null, skip running predict (#2402) (#2404)
Browse files Browse the repository at this point in the history
  • Loading branch information
opensearch-trigger-bot[bot] authored May 3, 2024
1 parent 32c9ef8 commit 29f443f
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 29f443f

Please sign in to comment.