Skip to content

Commit

Permalink
Update pinecone client version to 1.2.2 and remove redundant client v…
Browse files Browse the repository at this point in the history
…ersion declaration (#139)

## Problem

Prepare for releasing v1.2.2 and remove some redundancies when it comes
to declaring pinecone client version in the config and unit tests.

## Solution

Update pineconeClientVersion to v1.2.2 and remove redundancies for
updating pineconeClientVersion.

## Type of Change

- [X] None of the above: Refactoring codebase and updating client
version.

## Test Plan

Ran unit tests and tested with a locally published jar.
  • Loading branch information
rohanshah18 authored Jun 28, 2024
1 parent fb4fb48 commit 8034dab
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

[comment]: <> (When bumping [pc:VERSION_LATEST_RELEASE] create a new entry below)
### Unreleased version
### 1.2.2
- Add support for proxy configuration
- Fix user-agent for grpc

### 1.2.1
- Fix uber jar

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ Maven:
<dependency>
<groupId>io.pinecone</groupId>
<artifactId>pinecone-client</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
</dependency>
```

[comment]: <> (^ [pc:VERSION_LATEST_RELEASE])

Gradle:
```
implementation "io.pinecone:pinecone-client:1.2.1"
implementation "io.pinecone:pinecone-client:1.2.2"
```

[comment]: <> (^ [pc:VERSION_LATEST_RELEASE])

Alternatively, you can use our standalone uberjar [pinecone-client-1.2.1-all.jar](https://repo1.maven.org/maven2/io/pinecone/pinecone-client/1.2.1/pinecone-client-1.2.1-all.jar), which bundles the pinecone
Alternatively, you can use our standalone uberjar [pinecone-client-1.2.2-all.jar](https://repo1.maven.org/maven2/io/pinecone/pinecone-client/1.2.2/pinecone-client-1.2.2-all.jar), which bundles the pinecone
client and all dependencies together. You can include this in your classpath like you do with any 3rd party JAR without
having to obtain the *pinecone-client* dependencies separately.

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pineconeClientVersion = 1.2.1
pineconeClientVersion = 1.2.2
5 changes: 5 additions & 0 deletions src/main/java/io/pinecone/commons/Constants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package io.pinecone.commons;

public class Constants {
public static final String pineconeClientVersion = "v1.2.2";
}
4 changes: 3 additions & 1 deletion src/main/java/io/pinecone/configs/PineconeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import io.grpc.ManagedChannel;
import io.pinecone.exceptions.PineconeConfigurationException;

import static io.pinecone.commons.Constants.pineconeClientVersion;

/**
* The {@link PineconeConfig} class is responsible for managing the configuration settings
* required to interact with the Pinecone API. It provides methods to set and retrieve
Expand Down Expand Up @@ -206,7 +208,7 @@ public String getUserAgent() {
}

private String buildUserAgent() {
String userAgent = String.format("lang=java; %s=%s", "pineconeClientVersion", "v1.2.1");
String userAgent = String.format("lang=java; %s=%s", "pineconeClientVersion", pineconeClientVersion);
if (this.getSourceTag() != null && !this.getSourceTag().isEmpty()) {
userAgent += "; source_tag=" + this.getSourceTag();
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/pinecone/PineconeBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
import java.nio.file.Paths;
import java.util.AbstractMap;

import static io.pinecone.commons.Constants.pineconeClientVersion;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

public class PineconeBuilderTest {
private static final Gson gson = new Gson();
private static final String pineconeClientVersion = "v1.2.1";

private static AbstractMap.SimpleEntry<Call, OkHttpClient> buildMockCallAndClient(ResponseBody response) throws IOException {
Response mockResponse = new Response.Builder()
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/io/pinecone/PineconeConfigTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
import io.pinecone.exceptions.PineconeConfigurationException;
import org.junit.jupiter.api.Test;

import static io.pinecone.commons.Constants.pineconeClientVersion;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class PineconeConfigTest {

private static final String pineconeClientVersion = "v1.2.1";

@Test
public void testValidateWithNullApiKey() {
try {
Expand Down

0 comments on commit 8034dab

Please sign in to comment.