Skip to content

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
@fsxfreak fsxfreak requested review from jhamon and tdonia 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.

@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
@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.

2 participants