Skip to content

Commit

Permalink
Pulls all required data from content rather than from params, fixes j…
Browse files Browse the repository at this point in the history
…avadoc error

Signed-off-by: Joshua Palis <[email protected]>
  • Loading branch information
joshpalis committed Sep 20, 2023
1 parent 9fabe58 commit 5f1cc5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ opensearchplugin {
dependencyLicenses.enabled = false
// This requires an additional Jar not published as part of build-tools
loggerUsageCheck.enabled = false
thirdPartyAudit.enabled = false

// No need to validate pom, as we do not upload to maven/sonatype
validateNebulaPom.enabled = false
Expand Down Expand Up @@ -106,7 +107,7 @@ dependencies {
implementation "org.opensearch:opensearch:${opensearch_version}"
implementation 'org.junit.jupiter:junit-jupiter:5.10.0'
implementation "com.google.code.gson:gson:2.10.1"
compileOnly "com.google.guava:guava:32.1.2-jre"
implementation "com.google.guava:guava:32.1.2-jre"
api group: 'org.opensearch', name:'opensearch-ml-client', version: "${opensearch_build}"

configurations.all {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public class CreateIngestPipelineStep implements WorkflowStep {
// Client to store response data into global context index
private final Client client;

/**
* Instantiates a new CreateIngestPipelineStep
*
* @param client The client to create a pipeline and store workflow data into the global context index
*/
public CreateIngestPipelineStep(Client client) {
this.clusterAdminClient = client.admin().cluster();
this.client = client;
Expand All @@ -51,10 +56,11 @@ public CompletableFuture<WorkflowData> execute(List<WorkflowData> data) {

Map<String, String> parameters = workflowData.getParams();
Map<String, Object> content = workflowData.getContent();

Check warning on line 58 in src/main/java/org/opensearch/flowframework/workflow/CreateIngestPipelineStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/CreateIngestPipelineStep.java#L57-L58

Added lines #L57 - L58 were not covered by tests

logger.debug("Previous step sent params: {}, content: {}", parameters, content);

Check warning on line 60 in src/main/java/org/opensearch/flowframework/workflow/CreateIngestPipelineStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/CreateIngestPipelineStep.java#L60

Added line #L60 was not covered by tests

if (parameters.containsKey("id")) {
pipelineId = parameters.get("id");
if (content.containsKey("id")) {
pipelineId = (String) content.get("id");

Check warning on line 63 in src/main/java/org/opensearch/flowframework/workflow/CreateIngestPipelineStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/CreateIngestPipelineStep.java#L63

Added line #L63 was not covered by tests
}
if (content.containsKey("source")) {
source = (String) content.get("source");

Check warning on line 66 in src/main/java/org/opensearch/flowframework/workflow/CreateIngestPipelineStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/CreateIngestPipelineStep.java#L66

Added line #L66 was not covered by tests
Expand Down

0 comments on commit 5f1cc5b

Please sign in to comment.