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

Support overriding additional_headers with PINECONE_ADDITIONAL_HEADERS environment variable #304

Merged
merged 5 commits into from Feb 6, 2024

Conversation

fsxfreak
Copy link
Contributor

@fsxfreak fsxfreak commented Feb 5, 2024

Problem

We need a way to attach special request headers in integration testing.

Solution

Add support for overriding additional_headers via the PINECONE_ADDITIONAL_HEADERS environment variable.

Type of Change

  • New feature (non-breaking change which adds functionality)

Test Plan

Unit tests

$ cd pinecone-python-client/
$ export PINECONE_ADDITIONAL_HEADERS='{"header": "value"}'
$ python3
>>> from pinecone import Pinecone
>>> client = Pinecone(api_key='key', host='host')
>>> vars(client)
{'config': ... additional_headers={'header': 'value'}), ...}

@fsxfreak fsxfreak marked this pull request as ready for review February 6, 2024 17:07
Copy link
Collaborator

@jhamon jhamon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

pinecone/config/pinecone_config.py Outdated Show resolved Hide resolved
@jhamon jhamon changed the title Support overriding additional_headers with PINECONE_ADDITIONAL_HEADERS environment variable Support overriding additional_headers with PINECONE_ADDITIONAL_HEADERS environment variable Feb 6, 2024
@jhamon jhamon changed the title Support overriding additional_headers with PINECONE_ADDITIONAL_HEADERS environment variable Support overriding additional_headers with PINECONE_ADDITIONAL_HEADERS environment variable Feb 6, 2024
Co-authored-by: Jennifer Hamon <jhamon@pinecone.io>
@fsxfreak fsxfreak merged commit b8c12eb into main Feb 6, 2024
66 checks passed
@fsxfreak fsxfreak deleted the fsxfreak/additional-headers-env-var branch February 6, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants