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

Pass the openapi_config to the Index object #318

Closed
wants to merge 1 commit into from

Conversation

mcpaddy
Copy link

@mcpaddy mcpaddy commented Feb 29, 2024

Problem

The Data API does not use the proxy set in the openapi_config in Pinecone()

Solution

It passes the openapi_config down to Index()

Type of Change

  • 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

Spin up a proxy

brew install mitmproxy
/opt/homebrew/bin/mitmweb

Execute the following script

import os

import pinecone
from pinecone import Pinecone
from pinecone.core.client.configuration import Configuration as OpenApiConfiguration

print(f"Version {pinecone.utils.version.get_version()}")

openapi_config = OpenApiConfiguration.get_default_copy()
openapi_config.proxy = "http://0.0.0.0:8080"
openapi_config.ssl_ca_cert = '~/.mitmproxy/mitmproxy-ca-cert.pem'
openapi_config.api_key = {"ApiKeyAuth": f"{os.getenv('PINECONE_API_KEY')}"}

pc = Pinecone(openapi_config=openapi_config)
index = pc.Index("test")
print(index.describe_index_stats())

This fixes the issue of the Data API not using the proxy that is
configured via the openapi_config
@mcpaddy mcpaddy marked this pull request as draft February 29, 2024 00:13
@mcpaddy
Copy link
Author

mcpaddy commented Mar 5, 2024

There is an issue with how the API keys are checked when using openapi_config. This should be fixed in a different PR.

@jhamon
Copy link
Collaborator

jhamon commented Mar 14, 2024

Thanks for getting the ball rolling, but I'm going to close this since I covered both issues with tests in #321

@jhamon jhamon closed this Mar 14, 2024
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