Skip to content

Update Code - #87

Closed
pineconemachine wants to merge 1 commit into
mainfrom
ad567c
Closed

pineconemachine wants to merge 1 commit into
mainfrom
ad567c

Conversation

@pineconemachine

Copy link
Copy Markdown
Contributor

Update generated code from latest proto defintions

@rajat08 rajat08 closed this Jul 24, 2022
@rajat08
rajat08 deleted the ad567c branch July 24, 2022 20:01
@rajat08
rajat08 restored the ad567c branch July 24, 2022 20:01
@rajat08
rajat08 deleted the ad567c branch July 24, 2022 20:01
NishchayMahor pushed a commit to NishchayMahor/python-sdk-1 that referenced this pull request Sep 22, 2026
…ge (pinecone-io#167)

The measure for epoch pinecone-io#87: scripts/api_coverage.py derives the coverage
denominator from the 2026-07 OAS files (102 operations) and proto (12
rpcs), supports --report / --gaps / --verify / --gate / --write-manifest,
and gates on verified conformance coverage, version constants (with
DECISION exceptions), the vendored rust proto, and open epoch sub-issues.

tests/unit/conformance/ provides @api_op claim registration against a
generated manifest and a claim fixture that fails any test not genuinely
asserting method+path, the X-Pinecone-Api-Version: 2026-07 header, and
schema round-trip including optional-field-absent.

Closes pinecone-io#89
NishchayMahor pushed a commit to NishchayMahor/python-sdk-1 that referenced this pull request Sep 22, 2026
…l plane (pinecone-io#131) (pinecone-io#209)

* feat(rest)!: graduate sync indexes to the 2026-07 schema-based control plane

Rewrites pinecone/client/indexes.py around the 2026-07 db_control contract:
create() takes schema=/deployment=/read_capacity=/cmek_id= (name optional,
poll-until-ready default kept), configure() nests pod scaling under
deployment=, drops embed=, collapses read capacity into one top-level
kwarg, and returns the updated IndexModel; list() returns
Paginator[IndexModel]; create_for_model() is a new namespace method using
the backend-restored legacy wire shape (apis@5f808858, pinecone-db
@f6fd0a4). Legacy 2025-10 kwargs are intercepted client-side with guided
PineconeTypeError messages that interpolate the caller's values into the
equivalent 2026-07 call (epoch pinecone-io#87 guided-hard-break decision).
source_collection/source_backup_id are omitted per question pinecone-io#144;
the alpha filterable:true schema normalization is gone — server 400s
surface verbatim. Top-level shims migrate to the new signatures.

BREAKING CHANGE: see docs/migration/v10-2026-07-index-model.md. The branch
remains skewed (2025-10 version header) until pinecone-io#112 flips
CONTROL_PLANE_API_VERSION.

Closes pinecone-io#131

* docs(rest): use explicit code-block directives inside versionchanged (Sphinx/napoleon chokes on :: literal blocks there)
NishchayMahor pushed a commit to NishchayMahor/python-sdk-1 that referenced this pull request Sep 22, 2026
…inecone-io#123) (pinecone-io#241)

Replay the REST lane's 2026-07 selector algebra against AsyncIndex by calling
the same shared validators, so the two lanes cannot drift in wording.

- query: id is now exclusive with BOTH vector forms, not just the dense one,
  and the id itself is checked against the vector-ID rule
- update: filter may not carry values or sparse_values, because a by-filter
  update spans every matching record and can only set metadata
- delete/update/fetch_by_metadata: an empty filter is rejected, quoting each
  operation's own server wording verbatim
- fetch/delete: per-ID ASCII, no-NUL, 1-512 rules, naming the offending
  element by index
- list: prefix charset/length and limit 1-100
- fetch_by_metadata: limit 1-10000

No rule is restated here: every check calls the validator pinecone-io#122 put in
pinecone/_internal/validation.py, and the tests bind to that ticket's
QUERY_TRUTH_TABLE and VECTOR_OP_VALIDATION_CASES rather than repeating the
expected text. validation.py itself is untouched — consumed, not extended.

delete keeps its exactly-one-of semantics, deliberately stricter than the
spec's anyOf, per the recorded stance on pinecone-io#149. query's filter stays NOT
emptiness-checked, per the accepted-divergence pin on pinecone-io#122: QueryRequest.filter
carries no minProperties and the backend accepts an empty struct, so rejecting
it would exceed the server. describe_index_stats keeps forwarding its filter.

This completes the cross-transport parity that pinecone-io#122's waived AC-8 anticipated
(DECISION on pinecone-io#87): the new parity module asserts byte-identical request
snapshots and byte-identical rejection type and message for the whole matrix.

Coverage delta 0: all eight operations were already claimed by pinecone-io#91, so this
extends their assertions rather than re-claiming them.
NishchayMahor pushed a commit to NishchayMahor/python-sdk-1 that referenced this pull request Sep 22, 2026
…econe-io#260) (pinecone-io#279)

Three failures a caller could only find by watching a request fail — or, in
the delete case, by watching it never finish — now fail in the client with a
message that says what to do. Sync and async lanes are identical, and the
parity suites hold them to the same exception type and text.

`upload_file(file_stream=...)` defaulted the multipart filename to `"upload"`
when `file_name` was omitted. The backend types an uploaded file by its
extension alone and never inspects the bytes (svc-knowledge-engine
src/ingest/utils.rs:434-451, pinecone-db@f6fd0a4019), so that call was a
guaranteed 400 no matter what was in the stream. A stream now requires a
`file_name` carrying an extension, and the refusal names the ones the server
accepts (.txt, .pdf, .json, .md, .docx). `file_path` uploads are untouched:
the basename already supplies the extension.

`update()` with both `instructions` and `metadata` omitted built an empty
patch body and the server answered 400 "No updates provided". It now refuses
before sending, and the docstring records why `None` cannot clear a field:
`None` means "leave this alone" and is dropped from the body, so clearing
takes the empty value (`instructions=""`, `metadata={}`).

`delete()` polled describe-until-404 with no terminal-state check while the
server-side reconciler only rescues Create operations, so a delete that
failed left the assistant parked and `timeout=None` never returned. Polling
now stops on the terminal failure statuses `_poll_until_ready` already
guards ("Failed", "InitializationFailed") with a PineconeError naming the
state, and treats a reported "Terminated" as the delete having finished.
"Terminating" stays a normal transient state — that is a delete in flight.

Existing stream-upload tests gain the `file_name` the guard now requires;
the integration suites already passed one everywhere.

Closes pinecone-io#260

Provenance: wave-1 assistant findings 9+16+19, epoch pinecone-io#87, backend
@f6fd0a4019 (svc-knowledge-engine src/ingest/utils.rs:434-451).
NishchayMahor pushed a commit to NishchayMahor/python-sdk-1 that referenced this pull request Sep 22, 2026
pinecone-io#259) (pinecone-io#280)

The 2026-07 backend serves POST /chat/{name}/chat/completions as a plain
SSE stream with no keepalive, while POST /chat/{name} heartbeats every 15s.
An httpx read timeout measures the gap between chunks, not the length of the
answer, so on the completions endpoint any model that thinks for longer than
PineconeConfig.timeout — 30s by default — was indistinguishable from a dead
connection and the stream aborted mid-answer.

Streaming now floors its timeout at 300s, raising the client timeout but
never lowering it, so a client already configured above the floor keeps its
own value. Both chat endpoints get the floor so they fail alike. chat() and
chat_completions() also take an additive per-call `timeout` kwarg, matching
the per-call timeout Index/AsyncIndex/GrpcIndex already expose on every
data-plane method; it is used verbatim, including below the floor, and
applies to the non-streaming lane too. The risk and the semantics are
documented on both public methods.

_chat_completions_streaming gains the msgspec.ValidationError guard its
chat sibling already had: an SSE frame that is valid JSON but not a chunk
(an error envelope, say) is logged and skipped instead of killing the
stream part-way through an answer.

The `data: [DONE]` branches stay but are annotated as unreachable against
this backend, which ends the stream by closing it. Removing them would let
a conventionally-terminated stream from an intermediary reach orjson.loads,
and existing unit and conformance fixtures pin the behavior.

Sync and async, tested on both lanes: the floor, the override, the
never-lower rule, the non-streaming lane, the skipped frame, and a stalled
stream surfacing PineconeTimeoutError after earlier chunks were yielded.
A parity test pins the two duplicated module-level floors together.

Closes pinecone-io#259

Provenance: Wave-1 assistant findings 5+7, epoch pinecone-io#87, backend @ f6fd0a4019
(svc-knowledge-engine handler.rs:957 plain Sse::new; http_client.py:802,809).
NishchayMahor pushed a commit to NishchayMahor/python-sdk-1 that referenced this pull request Sep 22, 2026
…a milestone-driven epoch count (pinecone-io#381)

* fix(tooling): amend the release gate — a named 101/102 exemption and a milestone-driven epoch count

`--gate` is the release's mechanical stop condition, and both halves of it
were wrong.

Coverage: `db_metrics:fetch_prometheus_targets` is cut from 2026-07, so
101/102 is the real target. Rather than lowering the number — an
unexplained 101/102 is indistinguishable from a regression — the operation
is named in `COVERAGE_EXEMPTIONS` with a link to the DECISION that cut it.
The exemption excuses exactly the operation it names (`missing` is a set
difference, not a count allowance), the operation stays visible in
`--report` and `--gaps`, and a stale exemption — the operation gaining
passing coverage — fails the gate so the entry gets deleted.

Epoch count: pinecone-io#87 hit GitHub's 100-sub-issue cap, so closing tickets stopped
moving the count, ~24 tickets were invisible, and "zero open sub-issues"
could never become true — the condition was unfalsifiable. It now sums open
issues across the four 2026-07 milestones. Every milestone titled for the
release counts, so a fifth cannot hide work, and all four expected
milestones must exist, so a rename cannot silently drop one. `question`
issues carry no milestone and are exempt by construction — no label filter.

No other gate condition is weakened.

* fix(tooling): fail the gate on release issues that carry neither a milestone nor 'question'

Review on pinecone-io#381: the milestone sum relies on the converse of "question issues
carry no milestone" — that everything unmilestoned IS a question issue — and
that does not hold. pinecone-io#368, pinecone-io#371 and pinecone-io#374 all arrived `release/2026-07` with no
milestone and no `question` label; pinecone-io#371 is `breaking-change` and pinecone-io#374 a `bug`,
and all three would have been invisible to the sum. They were classified by
hand, which is the filing-discipline bet the sub-issue cap already lost.

A ticket is now legitimate in exactly two states — milestoned (release work,
counted) or `question` (upstream, exempt) — and neither state fails the gate
as its own `triage:` condition. The epoch issue is excepted by NUMBER, not by
label: pinecone-io#87 carries `release/2026-07` with no milestone and no `question` label,
so a label-based exception would not have covered it.

Also asserts the coverage exemption against the real manifest: the excused
operation is the named id and the required set is everything else, so a bare
101/102 cannot pass with a different operation silently dropped out.

* fix(tooling): treat only a counted milestone as classification in the triage check

Cursor Bugbot on pinecone-io#381: `unclassified_release_issues` accepted ANY milestone as
classification, while `release_milestone_status` sums only `2026-07*` titles.
A `release/2026-07` work ticket parked on `9.2.0` therefore read as classified
to one check and was counted by neither — invisible to the sum, exactly the
false-green the triage condition exists to prevent.

The two functions now agree on which milestones count: classification means a
milestone the sum actually sees, not merely a non-null milestone. No live
instance today, but the hole was real and silent.

* fix(tooling): paginate the milestone listing and refuse a truncated issue listing

Cursor Bugbot on pinecone-io#381: fetch_milestones requested per_page=100 with no
pagination. A release milestone holding open issues that fell past page one,
while the four expected titles were empty, would have turned the epoch
condition green with the work invisible — an unpaginated page cap silently
truncating is the same defect as the 100-sub-issue cap this ticket repairs, and
the query it replaced did paginate.

fetch_milestones now follows pages until one comes back short, and raises
rather than reporting a count it cannot vouch for. fetch_open_release_issues
gets the matching guard: hitting the fetch limit raises instead of triaging a
partial list. Both surface as gate FAIL conditions, never as a quiet pass.
NishchayMahor pushed a commit to NishchayMahor/python-sdk-1 that referenced this pull request Sep 22, 2026
…ded-hard-break decision (pinecone-io#505) (pinecone-io#513)

* chore: retrigger CI (initial run never registered a check-suite)

* fix(rest,asyncio): restore flat create_index/configure_index/list_indexes shims (pinecone-io#502)

Restores the 9.x flat backcompat shims to their legacy parameter lists as
thin delegating wrappers, undoing the 2026-07 drift that had them mirror
Indexes.create()/configure()'s new schema/deployment surface instead of
guarding it:

- create_index()/AsyncPinecone.create_index(): legacy-only params (name,
  spec, dimension, metric, vector_type, deletion_protection, tags, timeout).
  A new reject_new_only_create_kwargs() guard blocks deployment=/
  read_capacity=/cmek_id=/schema= from reaching Indexes.create() through the
  shim's own **legacy_kwargs passthrough, which stays open only for the
  pre-existing pods=/metadata_config=/source_collection=/source_backup_id=
  guided-error routing.
- configure_index(): legacy-only params (name, replicas, pod_type,
  deletion_protection, tags, embed, read_capacity, serverless_read_capacity).
  embed= reaches Indexes.configure()'s existing guided error; a None-vs-absent
  fix in reject_legacy_configure_kwargs() lets the shim forward embed=None
  unconditionally without falsely tripping that check on every call.
- list_indexes(): wraps the paginator back into IndexList so .names() works
  again; the async version is restored to `async def` so `await
  pc.list_indexes()` works again.
- create_index_for_model(): deletion_protection default restored to
  "disabled" and passed straight through (no more silently dropping an
  explicit "disabled"); cloud/region enum resolution now happens once, inside
  Indexes.create_for_model(), instead of being duplicated in the shim.

Tests: rewrote the flat-shim unit tests for the restored signatures, added
wire-level tests for create_index_for_model's deletion_protection default,
and added a structural AST-based test asserting each shim delegates without
branching, dict-building, or manual enum resolution.

* fix(rest,asyncio): scope None-kwarg filtering to embed/spec only in configure() shim (pinecone-io#502)

* fix(rest,asyncio): guide configure_index() 2026-07-only kwargs like create_index() (pinecone-io#502)

configure_index()/AsyncPinecone.configure_index() had no **kwargs, so a
caller passing deployment= or schema= (the 2026-07-only surface that moved
to pc.indexes.configure()) got a bare stdlib TypeError with no pointer to
the right method — unlike create_index(), which guards the analogous
kwargs with reject_new_only_create_kwargs() and names pc.indexes.create().

Adds reject_new_only_configure_kwargs()/NEW_ONLY_CONFIGURE_KWARGS in
index_migration.py, mirroring the create-side guard, and wires it into both
configure_index() shims before delegating. embed=/spec= still reach
Indexes.configure()'s existing guided error unchanged.

* docs(migration): document M5 backcompat surface without dev-history framing (pinecone-io#505)

Rewrites the deprecated-kwarg wording introduced while M5 was in
development to describe current state only, per the epoch pinecone-io#87 decision
that legacy create()/configure() kwargs are deprecated, keyword-only
sugar rather than a hard break:

- docs/migration/v10-2026-07-index-model.md: removed the stale "legacy
  keyword arguments are not silently translated" claim; the create/
  configure operations sections and the deprecated-spec-classes section
  now describe dimension=/metric=/vector_type=/spec=/replicas=/pod_type=/
  serverless_read_capacity= as deprecated sugar, without "restored"/
  "9.x vs 10.x" framing that implied an in-development removal no
  released version ever had.
- docs/migration/v10-2026-07-db-control.md: added a consolidated
  "Deprecated arguments" table (the release-notes ask) listing every
  deprecated create/configure argument, what it translates into, and
  that it's expected to be removed in a later major.
- pinecone/_internal/index_migration.py: rewrote the module docstring to
  describe the module's current scope — the create()/configure() kwargs
  with no faithful translation — and added the reject_new_only_create_kwargs/
  reject_new_only_configure_kwargs guard functions it was missing.
jhamon added a commit that referenced this pull request Oct 20, 2026
* fix(models): type-check top_k and limit on documents requests (#707)

* docs(documents): say search, fetch and list reject a non-integer top_k or limit

* fix(models): raise PineconeTypeError for wrong-type top_k and limit

Follows the #87 decision: a rejection because of an argument's type raises PineconeTypeError (a TypeError); PineconeValueError stays for range errors.
jhamon added a commit that referenced this pull request Oct 20, 2026
* fix(documents): accept numpy arrays as score_by vector values

* fix(documents): keep ValueError for missing dense values

* fix(documents): raise PineconeTypeError for scalar score_by vector values

Per the #87 decision, a type rejection raises PineconeTypeError. A scalar
(or 0-d numpy array) passed as DenseVectorQuery values, or as the indices
or values of a numpy-backed SparseValues in SparseVectorQuery, now raises
PineconeTypeError naming the expected type. None and empty values keep
raising ValueError as on main.

* docs(documents): document PineconeTypeError on vector clauses and align its messages

List PineconeTypeError in the Raises sections of DenseVectorQuery and
SparseVectorQuery, clarify the DenseVectorQuery.values wording, and make
both type-error messages say "numbers". Replace the "0-dimensional"
phrasing with the type whose tolist() returned a non-list, which is also
true for numpy scalars.
jhamon added a commit that referenced this pull request Oct 20, 2026
…ng it (#651)

* fix(validation): reject a non-str where a name or id is required

require_non_empty reached .strip() on whatever it was handed, so an int
raised AttributeError naming strip, and a non-empty list passed the guard
entirely and died inside urllib.parse.quote several frames later. Both are
now a PineconeValueError naming the parameter and the type it received.

The list branch goes with it: no caller in pinecone/ passes a list, and one
that got through could only have been a path parameter on its way to quote.

* fix(assistants,backups): refuse a non-str path parameter instead of coercing it

The assistants surface and backups.list wrapped each interpolation as
quote(str(...)), so an int id or a UUID reached the API as its str data and
named a resource that cannot exist. Every other path-parameter site already
refused. Type-correctness is not value-validation, so refusing here narrows
minimal validation rather than reversing it.

None keeps its documented meaning on backups.list: an omitted index_name
still lists backups across every index.

* test(paths): sweep every path parameter with a value of the wrong type

Drives the three existing operation tables with an int, a bool, a list and a
UUID, asserting a PineconeValueError that names the parameter and the type,
that nothing reaches the wire, and that both lanes word it identically.

Inverts the four tests that pinned coercion on backups.list and the
assistants surface.

* fix(imports): refuse a bulk-import id the URL encoder cannot take

describe_import and cancel_import document id as str | int and stringify an
int. Everything else fell through: a list reached urllib.parse.quote and
raised TypeError, a float died in len(). Both now raise PineconeValueError
naming the type, on all three lanes that build the path.

The documented int coercion is untouched.

* docs(migration): name the non-URL arguments the type guard also refuses

The path-parameter entry scoped the break to names and IDs the SDK
interpolates into a URL. The same guard fronts twelve arguments that never
reach one, so those move from AttributeError to PineconeValueError too and a
caller with an except AttributeError around inference.rerank(query=123) could
not find them in the guide.

* fix(paths): raise PineconeTypeError, not PineconeValueError, for a non-str name or id

Per the #87 decision, an argument rejected because of its type raises
PineconeTypeError; PineconeValueError stays for a right-typed, unusable value.
require_str and the bulk-import id guards now raise PineconeTypeError. Blank
strings still raise PineconeValueError, and the five pre-existing inline type
checks (namespace, vector id, id prefix) keep their class (tracked in #685).
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