Skip to content

Commit 343667e

Browse files
authored
Merge pull request opensearch-project#18 from zane-neo/main
Change version to 3.0 on main branch
2 parents c55329d + 1998260 commit 343667e

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

Diff for: build.gradle

+13-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
buildscript {
77
ext {
88
opensearch_group = "org.opensearch"
9-
opensearch_version = System.getProperty("opensearch.version", "2.11.0-SNAPSHOT")
9+
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
1010
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
1111
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
1212
}
@@ -26,7 +26,11 @@ buildscript {
2626
plugins {
2727
id 'java-library'
2828
id 'com.diffplug.spotless' version '6.23.0'
29-
id "io.freefair.lombok" version "8.0.1"
29+
id "io.freefair.lombok" version "8.4"
30+
}
31+
32+
lombok {
33+
version = "1.18.30"
3034
}
3135

3236
repositories {
@@ -82,6 +86,12 @@ task addJarsToClasspath(type: Copy) {
8286
dependencies {
8387
compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${version}"
8488
compileOnly group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
89+
compileOnly "org.apache.logging.log4j:log4j-slf4j-impl:2.19.0"
90+
compileOnly group: 'org.json', name: 'json', version: '20231013'
91+
zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${version}"
92+
implementation("com.google.guava:guava:32.0.1-jre")
93+
implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"])
94+
compileOnly "org.opensearch:common-utils:${version}"
8595
testImplementation "org.opensearch.test:framework:${opensearch_version}"
8696
testImplementation "org.mockito:mockito-core:3.10.0"
8797
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
@@ -90,10 +100,6 @@ dependencies {
90100
testImplementation "com.cronutils:cron-utils:9.1.6"
91101
testImplementation "commons-validator:commons-validator:1.7"
92102
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
93-
compileOnly "org.apache.logging.log4j:log4j-slf4j-impl:2.19.0"
94-
compileOnly group: 'org.json', name: 'json', version: '20231013'
95-
zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${version}"
96-
implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"])
97103
}
98104

99105
task extractSqlJar(type: Copy) {
@@ -110,6 +116,7 @@ tasks.validateNebulaPom.dependsOn ':generatePomFileForPluginZipPublication'
110116
dependencyLicenses.enabled = false
111117
loggerUsageCheck.enabled = false
112118
testingConventions.enabled = false
119+
thirdPartyAudit.enabled = false
113120

114121
test {
115122
useJUnitPlatform()

Diff for: src/main/java/org/opensearch/agent/tools/PPLTool.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
import org.opensearch.ml.common.transport.MLTaskResponse;
4444
import org.opensearch.ml.common.transport.prediction.MLPredictionTaskAction;
4545
import org.opensearch.ml.common.transport.prediction.MLPredictionTaskRequest;
46-
import org.opensearch.ml.repackage.com.google.common.collect.ImmutableMap;
4746
import org.opensearch.search.SearchHit;
4847
import org.opensearch.search.builder.SearchSourceBuilder;
4948
import org.opensearch.sql.plugin.transport.PPLQueryAction;
5049
import org.opensearch.sql.plugin.transport.TransportPPLQueryRequest;
5150
import org.opensearch.sql.plugin.transport.TransportPPLQueryResponse;
5251
import org.opensearch.sql.ppl.domain.PPLQueryRequest;
5352

53+
import com.google.common.collect.ImmutableMap;
5454
import com.google.gson.Gson;
5555

5656
import lombok.Getter;
@@ -108,7 +108,8 @@ public <T> void run(Map<String, String> parameters, ActionListener<T> listener)
108108
.build();
109109
ActionRequest request = new MLPredictionTaskRequest(
110110
modelId,
111-
MLInput.builder().algorithm(FunctionName.REMOTE).inputDataset(inputDataSet).build()
111+
MLInput.builder().algorithm(FunctionName.REMOTE).inputDataset(inputDataSet).build(),
112+
null
112113
);
113114
client.execute(MLPredictionTaskAction.INSTANCE, request, ActionListener.<MLTaskResponse>wrap(mlTaskResponse -> {
114115
ModelTensorOutput modelTensorOutput = (ModelTensorOutput) mlTaskResponse.getOutput();
@@ -317,10 +318,8 @@ private static TransportPPLQueryResponse fromActionResponse(ActionResponse actio
317318

318319
}
319320

320-
private Map<String, String> extractFromChatParameters(Map<String, String> parameters)
321-
{
322-
if (parameters.containsKey("input"))
323-
{
321+
private Map<String, String> extractFromChatParameters(Map<String, String> parameters) {
322+
if (parameters.containsKey("input")) {
324323
try {
325324
Map<String, String> chatParameters = gson.fromJson(parameters.get("input"), Map.class);
326325
parameters.putAll(chatParameters);

0 commit comments

Comments
 (0)