Skip to content

Pass the openapi_config to the Index object - #318

Closed
mcpaddy wants to merge 1 commit into
pinecone-io:mainfrom
mcpaddy:proxy
Closed

mcpaddy wants to merge 1 commit into
pinecone-io:mainfrom
mcpaddy:proxy

Conversation

@mcpaddy

@mcpaddy mcpaddy commented Feb 29, 2024 •

Copy link
Copy Markdown

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

mcpaddy commented Mar 5, 2024

Copy link
Copy Markdown
Author

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

@jhamon

jhamon commented Mar 14, 2024

Copy link
Copy Markdown
Collaborator

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
NishchayMahor pushed a commit to NishchayMahor/python-sdk-1 that referenced this pull request Sep 22, 2026
…the three confirmed backend defects (pinecone-io#318)

`docs/how-to/indexes/backups-and-restore.md` taught
`for job in pc.restore_jobs.list():` as the way to "List all restore jobs",
but `list` returns a single page and `RestoreJobList` holds its `pagination`
token without following it. Same mistake was present on the three
`pc.backups.list` examples on that page. All four now drive the token.

Adds caller-facing caveats to sync and async `list`/`describe` docstrings for
the three defects confirmed on pinecone-io#250: post-filter `next_page` truncating and
duplicating list pages, `describe` flattening every store failure to 404 (so a
404 cannot be trusted to mean "no such job"), and a deleted target index
producing an index-metadata-flavoured 404 on describe / silent omission on
list. Documentation only — claims 1 and 3 end the token stream itself and are
not compensable client-side.

Also aligns the sync `describe` Raises block onto `PineconeValueError`, which
is what `require_non_empty` raises and what the async twin already documented.

Closes pinecone-io#310
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