Skip to content

test(fts): add integration tests for FTS control plane#596

Merged
jhamon merged 4 commits into
ftsfrom
jhamon/sdk-113-integration-tests-control-plane
Jan 30, 2026
Merged

test(fts): add integration tests for FTS control plane#596
jhamon merged 4 commits into
ftsfrom
jhamon/sdk-113-integration-tests-control-plane

Conversation

@jhamon

@jhamon jhamon commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds comprehensive integration tests for the new Full-Text Search (FTS) control plane functionality. These tests verify the new schema-based API for creating Pinecone indexes with full-text search and vector capabilities.

Test Coverage

  • Schema-based Index Creation

    • Creating indexes with schema parameter using dict format
    • Creating indexes using field type classes (TextField, DenseVectorField, etc.)
    • Creating indexes using SchemaBuilder fluent API
    • Creating indexes with deletion protection
  • Deployment Configuration

    • Creating indexes with explicit ServerlessDeployment parameter
    • Verifying default deployment (aws/us-east-1) when deployment is omitted
  • describe_index Compatibility

    • Verifying .spec.serverless.cloud access pattern works
    • Verifying .dimension, .metric, .vector_type properties work
    • Testing that FTS-only indexes return None for vector properties
  • Error Handling

    • Testing mutual exclusion of spec and schema parameters
    • Validating error messages
  • Legacy Compatibility

    • Testing that legacy spec-based creation still works
    • Testing ServerlessSpec and dict-based spec formats

Usage Examples

Schema-based Index Creation with Field Classes

from pinecone import Pinecone, TextField, DenseVectorField

pc = Pinecone()
pc.db.index.create(
    name="my-index",
    schema={
        "title": TextField(full_text_searchable=True),
        "embedding": DenseVectorField(dimension=1536, metric="cosine"),
    }
)

Using SchemaBuilder

from pinecone import Pinecone, SchemaBuilder

pc = Pinecone()
schema = (SchemaBuilder()
    .text("title", full_text_searchable=True)
    .integer("year", filterable=True)
    .dense_vector("embedding", dimension=1536, metric="cosine")
    .build())

pc.db.index.create(name="my-index", schema=schema)

FTS-only Index

from pinecone import Pinecone, TextField

pc = Pinecone()
pc.db.index.create(
    name="fts-only-index",
    schema={
        "content": TextField(full_text_searchable=True),
    }
)

Related Issues


Note

Low Risk
Low risk since changes are test-only, but they create/cleanup real indexes and could impact CI stability/cost if cleanup or timeouts fail.

Overview
Adds a new tests/integration/rest_sync/db/control/fts integration test suite for the FTS control-plane.

Covers schema-based index creation via raw dicts, typed field classes, and SchemaBuilder, plus deletion protection and deployment defaults/overrides.

Verifies describe backward-compatibility shims (desc.spec.serverless.*, pod/byoc as None) and correct reporting of dimension/metric/vector_type, including FTS-only indexes returning None for vector properties. Also adds error/legacy coverage for spec vs schema mutual exclusion and older spec-based creation paths, with session-level cleanup of all indexes tagged to the test run.

Written by Cursor Bugbot for commit 18bbfc7. This will update automatically on new commits. Configure here.

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
@jhamon jhamon added the python Pull requests that update Python code label Jan 30, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread tests/integration/rest_sync/db/control/fts/conftest.py Outdated
Comment thread tests/integration/rest_sync/db/control/fts/conftest.py Outdated
Remove unused index_name, serverless_cloud, and serverless_region fixtures
that were flagged by Bugbot review.
@jhamon jhamon merged commit 36119d4 into fts Jan 30, 2026
7 checks passed
@jhamon jhamon deleted the jhamon/sdk-113-integration-tests-control-plane branch January 30, 2026 21:08
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.

1 participant