fix: honor IndexAsyncio config overrides#669
Open
pragnyanramtha wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
Pinecone.IndexAsyncio(...)andAsyncPinecone.IndexAsyncio(...)accepted**kwargs, but the compatibility factories ignored those values when constructingAsyncIndex. As a result, calls such aspc.IndexAsyncio(host=..., ssl_verify=False)still used the parent client's defaultssl_verify=True, which blocks proxy/local setups that need certificate verification disabled.Change
ssl_verify=False.Validation
uv sync --group dev --no-install-projectPYTHONPATH=. .venv/bin/python -m pytest tests/unit/test_pinecone_class.py::TestPineconeIndexAsyncioDelegate tests/unit/test_async_pinecone_backcompat.py -q(35 passed, 1 pytest config warning becausepytest-timeoutwas not installed by the no-project source-tree run)PYTHONPATH=. .venv/bin/python -m ruff check pinecone/_internal/indexes_helpers.py pinecone/_client.py pinecone/async_client/pinecone.py tests/unit/test_pinecone_class.py tests/unit/test_async_pinecone_backcompat.pyPYTHONPATH=. .venv/bin/python -m ruff format --check pinecone/_internal/indexes_helpers.py pinecone/_client.py pinecone/async_client/pinecone.py tests/unit/test_pinecone_class.py tests/unit/test_async_pinecone_backcompat.pyPYTHONPATH=. .venv/bin/python -m mypy --strict pinecone/_internal/indexes_helpers.py pinecone/_client.py pinecone/async_client/pinecone.pyNote: I initially tried
uv run pytest ..., but stopped it after it spent roughly 12 minutes compiling the native Rust extension through maturin before reaching pytest. The final checks above run from the source tree to keep validation focused on this Python-only compatibility change.Fixes #465.
Note
Medium Risk
Changes behavior of the
IndexAsynciobackcompat factories to apply/validate kwargs, which could break callers that previously passed (and had ignored) unsupported parameters. Limited to client construction-time configuration, with added unit coverage for the new semantics.Overview
Fixes the backcompat
IndexAsynciofactories on bothPineconeandAsyncPineconeto actually honor explicit data-plane overrides (e.g.ssl_verify=False) instead of always using parent-client defaults.Introduces
apply_index_kwargs_overrides()inindexes_helpersto merge supported overrides and raiseTypeErroron unknown kwargs (rather than silently ignoring them), and adds regression tests covering override forwarding and unknown-kwarg rejection.Reviewed by Cursor Bugbot for commit 86bee16. Bugbot is set up for automated code reviews on this repo. Configure here.