Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SDK version extraction #55

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[comment]: <> (When bumping [pc:VERSION_LATEST_RELEASE] create a new entry below)
### Unreleased version
### v0.7.2
- Fix extraction of SDK version

### v0.7.0
- Add support to list indexes
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>0.7.1</version>
<version>0.7.2</version>
</dependency>
```

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

Gradle:
```
implementation "io.pinecone:pinecone-client:0.7.1"
implementation "io.pinecone:pinecone-client:0.7.2"
```

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pineconeClientVersion = 0.7.1
pineconeClientVersion = 0.7.2
16 changes: 3 additions & 13 deletions src/main/java/io/pinecone/PineconeClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,8 @@ private String maskedApiKey() {
}

public String getUserAgent() {
Properties properties = new Properties();
String userAgentLanguage = "lang=java";
String version = (this.getUsageContext() != null) ?
userAgentLanguage + "; usageContext=" + this.getUsageContext()
: userAgentLanguage;

try (FileInputStream input = new FileInputStream("gradle.properties")) {
properties.load(input);
version = properties.getProperty("pineconeClientVersion") + "; " + version;
} catch (IOException e) {
throw new PineconeException("Unable to extract pinecone client version");
}
return version;
String userAgentLanguage = "lang=java; pineconeClientVersion = v0.7.2";
return (this.getUsageContext() != null) ?
userAgentLanguage + "; usageContext=" + this.getUsageContext() : userAgentLanguage;
}
}