Skip to content

Conversation

@jhamon
Copy link
Collaborator

@jhamon jhamon commented Jan 31, 2026

Summary

This PR adds comprehensive integration tests for the new FTS (Full-Text Search) data plane functionality:

  • search_documents() with text queries: Tests text search using text_query(), phrase matching with quoted strings, required terms (+term), boost and slop parameters, and $text_match filter operator
  • search_documents() with vector queries: Tests dense vector search using vector_query(), combined with metadata filtering and include_fields
  • upsert_documents(): Tests single/batch document upserts, document updates, and response validation
  • Document and DocumentSearchResponse access patterns: Tests attribute access, dict-style access, get() with defaults, iteration methods, and to_dict()
  • Backwards compatibility: Verifies that existing query(), upsert(), fetch(), and delete() methods continue to work with schema-based indexes

Also updates the __init__.pyi stub file to export new FTS types for proper mypy support:

  • TextQuery, VectorQuery, Document, DocumentSearchResponse
  • text_query, vector_query helper functions
  • Schema field types (TextField, IntegerField, etc.) and deployment classes

Test Plan

  • Tests pass in CI (pending SDK-116 to re-enable linting/unit tests)
  • Manual verification of test collection
  • All test files pass Python syntax validation

Related Issues

  • Linear: SDK-114
  • Depends on: SDK-113 (Integration tests - control plane)

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() and search_documents() for both text (TextQuery/text_query) and vector (VectorQuery/vector_query) scoring, plus filters (including $text_match) and include_fields; also validates Document/DocumentSearchResponse access patterns and verifies backwards compatibility of existing query/upsert/fetch/delete/describe_index_stats on schema-enabled indexes.

Updates pinecone/__init__.pyi to 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.

jhamon and others added 6 commits January 30, 2026 14:55
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
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.
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 <[email protected]>
@jhamon jhamon added the python Pull requests that update Python code label Jan 31, 2026
@jhamon jhamon merged commit deaf91a into fts Jan 31, 2026
7 checks passed
@jhamon jhamon deleted the jhamon/sdk-114-integration-tests-data-plane branch January 31, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants