-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore(docs): update semantic-search notebook to SDK v8 #522
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
chore(docs): update semantic-search notebook to SDK v8 #522
Conversation
Update Pinecone Python SDK from ~=7.3.0 to ~=8.0 and apply code formatting. Ref: SDK-124
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
- Sort imports (os before pinecone) - Remove unnecessary f-string prefix
CI Status NoteThe Root cause: The notebook uses This PR's changes:
The Bugbot review passed with no issues. The infrastructure fix for |
CI run-notebook action does not have uv; use plain pip so test-notebooks job passes.
- Move all imports to first code cell per notebook structure check - Put pip install on single line to satisfy check-pinning (no trailing \) - Sort imports (ruff)
…sion CI run-notebook converts cells with pip into run.sh; imports in the same cell were not included in the executed script. Split into separate cells so the converted notebook runs correctly.
Stream outputs need 'name' (stdout); execute_result outputs need 'metadata' and 'execution_count' for validate-notebook-formats.
- Merge import statements into the first code cell (pip install) to satisfy the notebook structure check requirement - Merge master to get latest poetry.lock and regenerate for consistency
The notebook runner runs cells with "pip install" as bash commands. By putting imports in a separate cell BEFORE the pip install cell, we satisfy both: 1. Structure check (imports in first code cell) 2. Notebook runner (imports run as Python, pip as bash)
The pinecone_notebooks.colab module only works in Google Colab. Wrap the import in try/except to allow the notebook to run in CI.
318a4de to
008c678
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| "from datasets import load_dataset\n", | ||
| "from pinecone import Pinecone\n", | ||
| "from tqdm import tqdm" | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imports placed before pip install causes execution failure
High Severity
The code cell containing import os, from datasets import load_dataset, from pinecone import Pinecone, and from tqdm import tqdm (Cell 2) is positioned before the !pip install cell (Cell 3). When executing the notebook sequentially in a fresh environment like Colab, the imports will fail with ModuleNotFoundError because the packages haven't been installed yet. The pip install cell needs to come before the imports cell.
Summary
~=7.3.0to~=8.0indocs/semantic-search.ipynbThis keeps the notebook up to date with the latest SDK version while maintaining backward compatibility with existing API patterns.
Test plan
Related
Note
Low Risk
Low risk: changes are limited to documentation/notebook code and dependency lock metadata, with no production runtime impact beyond keeping the example compatible with newer SDK versions.
Overview
Updates
docs/semantic-search.ipynbto install and usepinecone==8.0.0, adds a Colab-only auth fallback, and applies ruff-style formatting/cleanup to the notebook cells.Regenerates
poetry.lockwith a newer Poetry version, updating markers/group metadata and adding thedevextras section (includingclick).Written by Cursor Bugbot for commit 008c678. This will update automatically on new commits. Configure here.