Commit dc877fc
committed
feat(backcompat): plumb Pinecone(pool_threads=N) through to Index (BC-0110)
- Add `_LegacyIndexKwargs(IndexKwargs)` TypedDict in indexes_helpers.py with
`pool_threads: NotRequired[int]`; keeps `IndexKwargs` clean for async client
- Store `_legacy_pool_threads: int | None` on `Pinecone` instance (replaces silent
debug log); `_build_index_kwargs` returns `_LegacyIndexKwargs` and conditionally
includes `pool_threads` so `Index(**kwargs)` receives it and installs async_req
- Add `tests/unit/test_pinecone_pool_threads.py` with five unit tests covering:
attribute capture, kwarg propagation, field presence/absence, no-warning, and
end-to-end install-hook firing via `Pinecone.index(host=...)`1 parent f841f35 commit dc877fc
4 files changed
Lines changed: 74 additions & 22 deletions
File tree
- pinecone
- _internal
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | | - | |
51 | | - | |
52 | 49 | | |
53 | 50 | | |
54 | 51 | | |
| |||
108 | 105 | | |
109 | 106 | | |
110 | 107 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | 108 | | |
119 | 109 | | |
120 | 110 | | |
| |||
153 | 143 | | |
154 | 144 | | |
155 | 145 | | |
| 146 | + | |
156 | 147 | | |
157 | 148 | | |
158 | 149 | | |
| |||
372 | 363 | | |
373 | 364 | | |
374 | 365 | | |
375 | | - | |
376 | | - | |
377 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
378 | 369 | | |
379 | 370 | | |
380 | 371 | | |
| |||
386 | 377 | | |
387 | 378 | | |
388 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
389 | 383 | | |
390 | 384 | | |
391 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
489 | 488 | | |
490 | 489 | | |
491 | 490 | | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
499 | 494 | | |
500 | 495 | | |
501 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
0 commit comments