Skip to content

Commit f6bda12

Browse files
authored
update urllib3_response.headers.get as getheader is deprecated (#197)
## Problem Follow up to #195, which updated to use `urllib.headers` -- there's also a deprecation for `getheader` coming: urllib3/urllib3#2814 ## Solution Updated the call in `rest.py` to use `.get` instead of `.getheader`; based on the [code](https://github.com/urllib3/urllib3/blob/1.2.1/urllib3/response.py#L191C29-L191C32) this should be compatible with 1.2.1, [our current min version](https://github.com/pinecone-io/pinecone-python-client/blob/main/requirements.txt#L8) ## 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 REST requests should work without a notice in URLLib3 2.0.4+
1 parent d0c434f commit f6bda12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pinecone/core/client/rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def getheaders(self):
4242

4343
def getheader(self, name, default=None):
4444
"""Returns a given response header."""
45-
return self.urllib3_response.headers.getheader(name, default)
45+
return self.urllib3_response.headers.get(name, default)
4646

4747

4848
class RESTClientObject(object):

0 commit comments

Comments
 (0)