Skip to content

Commit 3a0de7b

Browse files
authored
Fix SDK version extraction (#55)
## Problem While trying to add SDK version to user agent string, it fails. ## Solution Hard coded the value into the user agent string. ## Type of Change - [X] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update - [ ] Infrastructure change (CI configs, etc) - [ ] Non-code change (docs, etc) - [ ] None of the above: (explain here) ## Test Plan Ran integration tests locally.
1 parent 231657c commit 3a0de7b

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

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

68
### v0.7.0
79
- Add support to list indexes

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ Maven:
1515
<dependency>
1616
<groupId>io.pinecone</groupId>
1717
<artifactId>pinecone-client</artifactId>
18-
<version>0.7.1</version>
18+
<version>0.7.2</version>
1919
</dependency>
2020
```
2121

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

2424
Gradle:
2525
```
26-
implementation "io.pinecone:pinecone-client:0.7.1"
26+
implementation "io.pinecone:pinecone-client:0.7.2"
2727
```
2828

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

31-
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.
31+
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.
3232

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

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pineconeClientVersion = 0.7.1
1+
pineconeClientVersion = 0.7.2

src/main/java/io/pinecone/PineconeClientConfig.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,8 @@ private String maskedApiKey() {
139139
}
140140

141141
public String getUserAgent() {
142-
Properties properties = new Properties();
143-
String userAgentLanguage = "lang=java";
144-
String version = (this.getUsageContext() != null) ?
145-
userAgentLanguage + "; usageContext=" + this.getUsageContext()
146-
: userAgentLanguage;
147-
148-
try (FileInputStream input = new FileInputStream("gradle.properties")) {
149-
properties.load(input);
150-
version = properties.getProperty("pineconeClientVersion") + "; " + version;
151-
} catch (IOException e) {
152-
throw new PineconeException("Unable to extract pinecone client version");
153-
}
154-
return version;
142+
String userAgentLanguage = "lang=java; pineconeClientVersion = v0.7.2";
143+
return (this.getUsageContext() != null) ?
144+
userAgentLanguage + "; usageContext=" + this.getUsageContext() : userAgentLanguage;
155145
}
156146
}

0 commit comments

Comments
 (0)