test(fts): add integration tests for FTS data plane#597
Merged
Conversation
Add the upsert_documents() method to enable upserting flat JSON documents into a namespace. Documents are indexed based on the configured index schema and must have an _id field. - Add upsert_documents() to Index class (sync) - Add upsert_documents() to IndexAsyncio class (async) - Add method signature to IndexInterface and IndexAsyncioInterface - Add comprehensive unit tests for validation and API calls Relates to: SDK-112
…nt-upsert_documents-method
Add comprehensive integration tests for the new Full-Text Search (FTS) control plane functionality including: - Schema-based index creation (dict format, field type classes, SchemaBuilder) - Deployment configuration (explicit ServerlessDeployment, default deployment) - describe_index compatibility (.spec.serverless.cloud, dimension, metric) - FTS-only indexes (return None for vector properties) - Error handling (spec/schema mutual exclusion, validation) - Legacy spec-based creation compatibility These tests verify the new schema-based API for creating Pinecone indexes with full-text search and vector capabilities. Relates to: SDK-113
Remove unused index_name, serverless_cloud, and serverless_region fixtures that were flagged by Bugbot review.
…tion-tests-control-plane
Add comprehensive integration tests for the new FTS data plane functionality: - search_documents() with text queries (text_query, phrase matching, required terms, boost/slop parameters, $text_match filter) - search_documents() with vector queries (vector_query, filters, include_fields) - upsert_documents() (single/batch upserts, updates, response validation) - Document and DocumentSearchResponse access patterns (attribute access, dict access, get() with defaults, iteration, to_dict()) - Backwards compatibility (query(), upsert(), fetch(), delete() still work) Also updates __init__.pyi stub file to export new FTS types: - TextQuery, VectorQuery, Document, DocumentSearchResponse - text_query, vector_query helper functions - Schema field types and deployment classes Related to SDK-114 Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
This PR adds comprehensive integration tests for the new FTS (Full-Text Search) data plane functionality:
text_query(), phrase matching with quoted strings, required terms (+term), boost and slop parameters, and$text_matchfilter operatorvector_query(), combined with metadata filtering andinclude_fieldsget()with defaults, iteration methods, andto_dict()query(),upsert(),fetch(), anddelete()methods continue to work with schema-based indexesAlso updates the
__init__.pyistub file to export new FTS types for proper mypy support:TextQuery,VectorQuery,Document,DocumentSearchResponsetext_query,vector_queryhelper functionsTextField,IntegerField, etc.) and deployment classesTest Plan
Related Issues
Made with Cursor
Note
Medium Risk
Adds a large suite of REST-only integration tests that create/delete real indexes and upsert/search data, which can be flaky or slow depending on environment and backend availability. Production library logic changes are limited to type-stub exports, so functional risk to SDK runtime is low.
Overview
Adds a new REST-sync integration test suite for FTS/schema-based indexes, including fixtures that create an index with a metadata schema, seed documents, and clean up via tagged deletion.
Covers
upsert_documents()andsearch_documents()for both text (TextQuery/text_query) and vector (VectorQuery/vector_query) scoring, plus filters (including$text_match) andinclude_fields; also validatesDocument/DocumentSearchResponseaccess patterns and verifies backwards compatibility of existingquery/upsert/fetch/delete/describe_index_statson schema-enabled indexes.Updates
pinecone/__init__.pyito export the new FTS query/document types and helper functions, and re-export schema field and deployment types for typing/mypy support.Written by Cursor Bugbot for commit bdcf685. This will update automatically on new commits. Configure here.