Skip to content

Commit e33cb35

Browse files
authored
Merge pull request #12 from psilberk/cicd-errors
Fixed errors returned by CI on JDK8
2 parents faa2b68 + 3b49161 commit e33cb35

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

data/semantickernel-data-oracle/src/main/java/com/microsoft/semantickernel/data/jdbc/oracle/OracleVectorStoreQueryProvider.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ public void createCollection(String collectionName,
245245
* @param options the options
246246
*/
247247
@Override
248+
@SuppressFBWarnings("SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING")
248249
public void upsertRecords(String collectionName,
249250
List<?> records,
250251
VectorStoreRecordDefinition recordDefinition,
@@ -422,6 +423,7 @@ private void setUpsertStatementValues(PreparedStatement upsertStatement, Object
422423
* @param <Record> the record type
423424
*/
424425
@Override
426+
@SuppressFBWarnings("SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING")
425427
public <Record> VectorSearchResults<Record> search(String collectionName, List<Float> vector,
426428
VectorSearchOptions options, VectorStoreRecordDefinition recordDefinition,
427429
VectorStoreRecordMapper<Record, ResultSet> mapper) {
@@ -558,8 +560,6 @@ private void setSearchParameter(PreparedStatement statement, int index, Class<?>
558560
// Use JSON string to set lists
559561
if (List.class.equals(type)) {
560562
statement.setObject(index, objectMapper.writeValueAsString(value));
561-
System.out.println(
562-
"Set values: " + objectMapper.writeValueAsString(value));
563563
return;
564564
}
565565
// convert UUID to string
@@ -575,7 +575,6 @@ private void setSearchParameter(PreparedStatement statement, int index, Class<?>
575575
OffsetDateTime offsetDateTime = (OffsetDateTime) value;
576576
((OraclePreparedStatement) statement).setTIMESTAMPTZ(index,
577577
TIMESTAMPTZ.of(offsetDateTime));
578-
System.out.println("Set values: " + offsetDateTime);
579578
}
580579
return;
581580
}
@@ -587,7 +586,6 @@ private void setSearchParameter(PreparedStatement statement, int index, Class<?>
587586
BigDecimal bigDecimal = (BigDecimal) value;
588587
((OraclePreparedStatement) statement).setBigDecimal(index,
589588
bigDecimal);
590-
System.out.println("Set values: " + bigDecimal);
591589
}
592590
return;
593591
}
@@ -825,6 +823,7 @@ public Builder withPrefixForCollectionTables(String prefixForCollectionTables) {
825823
* @param objectMapper the object mapper
826824
* @return the builder
827825
*/
826+
@SuppressFBWarnings("EI_EXPOSE_REP2")
828827
public Builder withObjectMapper(
829828
ObjectMapper objectMapper) {
830829
this.objectMapper = objectMapper;

data/semantickernel-data-oracle/src/main/java/com/microsoft/semantickernel/data/jdbc/oracle/OracleVectorStoreRecordMapper.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import java.sql.ResultSet;
4242
import java.sql.SQLException;
4343
import java.util.Map;
44+
import java.util.HashMap;
4445
import java.util.UUID;
4546
import java.util.function.BiFunction;
4647

@@ -91,7 +92,6 @@ public static class Builder<Record>
9192
private VectorStoreRecordDefinition vectorStoreRecordDefinition;
9293
private Map<Class<?>, String> supportedDataTypesMapping;
9394
private ObjectMapper objectMapper = new ObjectMapper();
94-
private Map<Class<?>, String> annotatedTypeMapping;
9595

9696
/**
9797
* Sets the record class.
@@ -137,12 +137,7 @@ public Builder<Record> withObjectMapper(ObjectMapper objectMapper) {
137137
*/
138138
public Builder<Record> withSupportedDataTypesMapping(
139139
Map<Class<?>, String> supportedDataTypesMapping) {
140-
this.supportedDataTypesMapping = supportedDataTypesMapping;
141-
return this;
142-
}
143-
144-
public Builder<Record> withAnnotatedTypeMapping(Map<Class<?>, String> annotatedTypeMapping) {
145-
this.annotatedTypeMapping = annotatedTypeMapping;
140+
this.supportedDataTypesMapping = new HashMap<>(supportedDataTypesMapping);
146141
return this;
147142
}
148143

data/semantickernel-data-oracle/src/test/java/com/microsoft/semantickernel/data/jdbc/oracle/OracleVectorStoreExtendedTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ void testVectorDimensionMismatch() {
203203
DummyRecord d1 = new DummyRecord("id1", 4, 120d, new float[]{});
204204
SKException ex = assertThrows(SKException.class,
205205
() -> collection.upsertBatchAsync(Arrays.asList(d1), null).block());
206-
System.out.println(ex.getMessage());
207206
assertTrue(ex.getCause().getMessage().contains("ORA-51803"));
208207

209208
// Vector dimension mismatch

data/semantickernel-data-oracle/src/test/java/com/microsoft/semantickernel/data/jdbc/oracle/OracleVectorStoreRecordCollectionTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,6 @@ public void exactSearch(DistanceFunction distanceFunction, List<Double> expected
215215
assertNotNull(results);
216216
assertEquals(3, results.size());
217217
// The third hotel should be the most similar
218-
System.out.println(results.get(0).getScore());
219-
System.out.println(results.get(1).getScore());
220-
System.out.println(results.get(2).getScore());
221218
assertEquals(hotels.get(2).getId(), results.get(0).getRecord().getId());
222219
assertEquals(expectedDistance.get(0).doubleValue(), results.get(0).getScore(), 0.0001d);
223220
assertEquals(hotels.get(0).getId(), results.get(1).getRecord().getId());

0 commit comments

Comments
 (0)