Skip to content

Commit d391c9a

Browse files
authored
Add Missing Method Documentation (#560)
# Add Missing Method Documentation ## Problem Several methods implemented in the codebase were missing from the Sphinx documentation files (`rest.rst`, `grpc.rst`, and `asyncio.rst`). This made it difficult for users to discover available functionality through the generated documentation. ## Solution Added documentation entries for all missing methods across all three documentation files, ensuring complete coverage of the API surface. ## Changes ### `docs/rest.rst` (Pinecone and Index classes) - **Vectors section**: Added `fetch_by_metadata`, `update`, `upsert_from_dataframe` - **Records section**: Added `upsert_records` (was previously missing) - **Namespaces section** (new): Added `create_namespace`, `describe_namespace`, `delete_namespace`, `list_namespaces`, `list_namespaces_paginated` ### `docs/grpc.rst` (PineconeGRPC and GRPCIndex classes) - **PineconeGRPC**: Added `Index` method documentation - **GRPCIndex Vectors section**: Added `fetch_by_metadata`, `update`, `upsert_from_dataframe` - **GRPCIndex Namespaces section**: Added `create_namespace` and reordered namespace methods for consistency ### `docs/asyncio.rst` (PineconeAsyncio and IndexAsyncio classes) - **PineconeAsyncio**: Added `IndexAsyncio` and `close` method documentation - **IndexAsyncio Vectors section**: Added `fetch_by_metadata`, `update`, `upsert_from_dataframe` - **IndexAsyncio Bulk Import section** (new): Added `start_import`, `list_imports`, `list_imports_paginated`, `describe_import`, `cancel_import` - **IndexAsyncio Records section**: Added `upsert_records` (was previously missing) - **IndexAsyncio Namespaces section** (new): Added `create_namespace`, `describe_namespace`, `delete_namespace`, `list_namespaces`, `list_namespaces_paginated` ## Impact Users can now discover all available methods through the generated Sphinx documentation. The documentation is now complete and accurately reflects the full API surface across all client implementations (REST, gRPC, and asyncio). ## Breaking Changes None. This is a documentation-only change that adds missing entries without modifying any code or existing documentation.
1 parent 8fb1b4d commit d391c9a

File tree

5 files changed

+232
-4
lines changed

5 files changed

+232
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ For notes on changes between major versions, see [Upgrading](./docs/upgrading.md
1919

2020
## Prerequisites
2121

22-
- The Pinecone Python SDK is compatible with Python 3.10 and greater. It has been tested with CPython versions from 3.10 to 3.13.
22+
- The Pinecone Python SDK requires Python 3.10 or greater. It has been tested with CPython versions from 3.10 to 3.13.
2323
- Before you can use the Pinecone SDK, you must sign up for an account and find your API key in the Pinecone console dashboard at [https://app.pinecone.io](https://app.pinecone.io).
2424

2525
## Installation

docs/asyncio.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ PineconeAsyncio
66

77
.. automethod:: pinecone::PineconeAsyncio.__init__
88

9+
.. automethod:: pinecone::PineconeAsyncio.IndexAsyncio
10+
11+
.. automethod:: pinecone::PineconeAsyncio.close
12+
913
DB Control Plane
1014
================
1115

@@ -83,17 +87,54 @@ Vectors
8387

8488
.. automethod:: pinecone.db_data::IndexAsyncio.list_paginated
8589

90+
.. automethod:: pinecone.db_data::IndexAsyncio.fetch_by_metadata
91+
92+
.. automethod:: pinecone.db_data::IndexAsyncio.update
93+
94+
.. automethod:: pinecone.db_data::IndexAsyncio.upsert_from_dataframe
95+
96+
97+
Bulk Import
98+
-----------
99+
100+
.. automethod:: pinecone.db_data::IndexAsyncio.start_import
101+
102+
.. automethod:: pinecone.db_data::IndexAsyncio.list_imports
103+
104+
.. automethod:: pinecone.db_data::IndexAsyncio.list_imports_paginated
105+
106+
.. automethod:: pinecone.db_data::IndexAsyncio.describe_import
107+
108+
.. automethod:: pinecone.db_data::IndexAsyncio.cancel_import
109+
110+
86111
Records
87112
-------
88113

89114
If you have created an index using integrated inference, you can use the following methods to
90115
search and retrieve records.
91116

117+
.. automethod:: pinecone.db_data::IndexAsyncio.upsert_records
118+
92119
.. automethod:: pinecone.db_data::IndexAsyncio.search
93120

94121
.. automethod:: pinecone.db_data::IndexAsyncio.search_records
95122

96123

124+
Namespaces
125+
----------
126+
127+
.. automethod:: pinecone.db_data::IndexAsyncio.create_namespace
128+
129+
.. automethod:: pinecone.db_data::IndexAsyncio.describe_namespace
130+
131+
.. automethod:: pinecone.db_data::IndexAsyncio.delete_namespace
132+
133+
.. automethod:: pinecone.db_data::IndexAsyncio.list_namespaces
134+
135+
.. automethod:: pinecone.db_data::IndexAsyncio.list_namespaces_paginated
136+
137+
97138

98139
Inference
99140
=========

docs/grpc.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ PineconeGRPC
44

55
.. autoclass:: pinecone.grpc::PineconeGRPC
66

7+
.. automethod:: pinecone.grpc::PineconeGRPC.Index
8+
79
DB Control Plane
810
================
911

@@ -81,13 +83,21 @@ Vectors
8183

8284
.. automethod:: pinecone.grpc::GRPCIndex.list_paginated
8385

86+
.. automethod:: pinecone.grpc::GRPCIndex.fetch_by_metadata
87+
88+
.. automethod:: pinecone.grpc::GRPCIndex.update
89+
90+
.. automethod:: pinecone.grpc::GRPCIndex.upsert_from_dataframe
91+
8492
Namespaces
8593
----------
8694

87-
.. automethod:: pinecone.grpc::GRPCIndex.list_namespaces
88-
89-
.. automethod:: pinecone.grpc::GRPCIndex.list_namespaces_paginated
95+
.. automethod:: pinecone.grpc::GRPCIndex.create_namespace
9096

9197
.. automethod:: pinecone.grpc::GRPCIndex.describe_namespace
9298

9399
.. automethod:: pinecone.grpc::GRPCIndex.delete_namespace
100+
101+
.. automethod:: pinecone.grpc::GRPCIndex.list_namespaces
102+
103+
.. automethod:: pinecone.grpc::GRPCIndex.list_namespaces_paginated

docs/rest.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ Vectors
8787

8888
.. automethod:: pinecone.db_data::Index.list_paginated
8989

90+
.. automethod:: pinecone.db_data::Index.fetch_by_metadata
91+
92+
.. automethod:: pinecone.db_data::Index.update
93+
94+
.. automethod:: pinecone.db_data::Index.upsert_from_dataframe
95+
9096

9197
Bulk Import
9298
-----------
@@ -108,11 +114,27 @@ Records
108114
If you have created an index using integrated inference, you can use the following methods to
109115
search and retrieve records.
110116

117+
.. automethod:: pinecone.db_data::Index.upsert_records
118+
111119
.. automethod:: pinecone.db_data::Index.search
112120

113121
.. automethod:: pinecone.db_data::Index.search_records
114122

115123

124+
Namespaces
125+
----------
126+
127+
.. automethod:: pinecone.db_data::Index.create_namespace
128+
129+
.. automethod:: pinecone.db_data::Index.describe_namespace
130+
131+
.. automethod:: pinecone.db_data::Index.delete_namespace
132+
133+
.. automethod:: pinecone.db_data::Index.list_namespaces
134+
135+
.. automethod:: pinecone.db_data::Index.list_namespaces_paginated
136+
137+
116138

117139
Inference
118140
=========

docs/upgrading.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,161 @@ The official SDK package was renamed from `pinecone-client` to `pinecone` beginn
44
Please remove `pinecone-client` from your project dependencies and add `pinecone` instead to get
55
the latest updates.
66

7+
## Upgrading from `7.x` to `8.x`
8+
9+
### Breaking changes in 8.x
10+
11+
⚠️ **Python 3.9 is no longer supported.** The SDK now requires Python 3.10 or later. Python 3.9 reached end-of-life on October 2, 2025. Users must upgrade to Python 3.10+ to continue using the SDK.
12+
13+
⚠️ **Namespace parameter default behavior changed.** The SDK no longer applies default values for the `namespace` parameter in GRPC methods. When `namespace=None`, the parameter is omitted from requests, allowing the API to handle namespace defaults appropriately. This change affects `upsert_from_dataframe` methods in GRPC clients. The API is moving toward `"__default__"` as the default namespace value, and this change ensures the SDK doesn't override API defaults.
14+
15+
### Useful additions in `8.x`
16+
17+
**Most Important Features:**
18+
19+
1. **Dedicated Read Capacity for Serverless Indexes**: Configure dedicated read nodes with manual scaling control for better performance and capacity planning. You can create indexes with dedicated read capacity or configure existing indexes to switch between OnDemand and Dedicated modes.
20+
21+
2. **Fetch and Update by Metadata**:
22+
- `fetch_by_metadata()`: Retrieve vectors using metadata filters instead of vector IDs, with pagination support
23+
- `update()` with `filter` parameter: Bulk update vectors matching metadata criteria
24+
- `FilterBuilder`: Fluent, type-safe interface for constructing metadata filters with AND/OR logic
25+
26+
**Other New Features:**
27+
28+
- `create_namespace()`: Programmatically create namespaces in serverless indexes
29+
- `match_terms` parameter: Specify required terms in search operations for sparse indexes
30+
- Admin API enhancements: Update API keys, projects, and organizations; delete organizations
31+
- Metadata schema configuration: Control which metadata fields are filterable when creating indexes
32+
- LSN header information: Access Log Sequence Number information from API responses
33+
34+
**Performance Improvements:**
35+
36+
- **orjson adoption**: 10-23x faster JSON serialization/deserialization (see [PR #556](https://github.com/pinecone-io/pinecone-python-client/pull/556))
37+
- **gRPC response parsing optimization**: ~2x faster response parsing (see [PR #553](https://github.com/pinecone-io/pinecone-python-client/pull/553))
38+
39+
**Other Improvements:**
40+
41+
- Comprehensive type hints with Python 3.10+ syntax throughout the SDK
42+
- Updated docstrings with RST formatting and code examples
43+
- Updated protobuf to 5.29.5 for security
44+
- Migrated from poetry to uv for faster dependency management
45+
46+
### Dedicated Read Capacity for Serverless Indexes
47+
48+
You can now configure dedicated read nodes for your serverless indexes. By default, serverless indexes use OnDemand read capacity, which automatically scales based on demand. With dedicated read capacity, you can allocate specific read nodes with manual scaling control.
49+
50+
```python
51+
from pinecone import (
52+
Pinecone,
53+
ServerlessSpec,
54+
CloudProvider,
55+
AwsRegion,
56+
Metric
57+
)
58+
59+
pc = Pinecone()
60+
61+
# Create an index with dedicated read capacity
62+
pc.create_index(
63+
name='my-index',
64+
dimension=1536,
65+
metric=Metric.COSINE,
66+
spec=ServerlessSpec(
67+
cloud=CloudProvider.AWS,
68+
region=AwsRegion.US_EAST_1,
69+
read_capacity={
70+
"mode": "Dedicated",
71+
"dedicated": {
72+
"node_type": "t1",
73+
"scaling": "Manual",
74+
"manual": {
75+
"shards": 2,
76+
"replicas": 2
77+
}
78+
}
79+
}
80+
)
81+
)
82+
83+
# Configure read capacity on an existing index
84+
pc.configure_index(
85+
name='my-index',
86+
read_capacity={
87+
"mode": "Dedicated",
88+
"dedicated": {
89+
"node_type": "t1",
90+
"scaling": "Manual",
91+
"manual": {
92+
"shards": 3,
93+
"replicas": 2
94+
}
95+
}
96+
}
97+
)
98+
```
99+
100+
### Fetch and Update Vectors by Metadata
101+
102+
#### Fetch vectors by metadata filter
103+
104+
```python
105+
from pinecone import Pinecone
106+
107+
pc = Pinecone()
108+
index = pc.Index(host="your-index-host")
109+
110+
# Fetch vectors matching a filter
111+
response = index.fetch_by_metadata(
112+
filter={'genre': {'$in': ['comedy', 'drama']}, 'year': {'$eq': 2019}},
113+
namespace='my_namespace',
114+
limit=50
115+
)
116+
117+
# Use pagination for large result sets
118+
if response.pagination and response.pagination.next:
119+
next_response = index.fetch_by_metadata(
120+
filter={'status': 'active'},
121+
pagination_token=response.pagination.next,
122+
limit=100
123+
)
124+
```
125+
126+
#### Update vectors by metadata filter
127+
128+
```python
129+
# Update metadata for all vectors matching the filter
130+
response = index.update(
131+
set_metadata={'status': 'active'},
132+
filter={'genre': {'$eq': 'drama'}},
133+
namespace='my_namespace'
134+
)
135+
136+
# Preview updates with dry run
137+
response = index.update(
138+
set_metadata={'status': 'active'},
139+
filter={'genre': {'$eq': 'drama'}},
140+
dry_run=True
141+
)
142+
```
143+
144+
#### FilterBuilder for fluent filter construction
145+
146+
```python
147+
from pinecone import FilterBuilder
148+
149+
# Simple filter
150+
filter1 = FilterBuilder().eq("genre", "drama").build()
151+
152+
# Complex filter with AND/OR logic
153+
filter2 = ((FilterBuilder().eq("genre", "drama") &
154+
FilterBuilder().gte("year", 2020)) |
155+
(FilterBuilder().eq("genre", "comedy") &
156+
FilterBuilder().lt("year", 2000))).build()
157+
158+
# Use with fetch_by_metadata or update
159+
response = index.fetch_by_metadata(filter=filter2, limit=50)
160+
```
161+
7162
## Upgrading from `6.x` to `7.x`
8163

9164
There are no intentional breaking changes when moving from v6 to v7 of the SDK. The major version bump reflects the move from calling the `2025-01` to the `2025-04` version of the underlying API.

0 commit comments

Comments
 (0)