feat: add schema field type classes for FTS#582
Merged
Conversation
Add user-friendly schema field classes for defining index schemas: - TextField: for string fields with filterable/full_text_searchable options - IntegerField: for integer fields with filterable option - FloatField: for float fields with filterable option - DenseVectorField: for dense vector embeddings with dimension/metric - SparseVectorField: for sparse vector embeddings - SemanticTextField: for integrated inference with model configuration Each class provides a to_dict() method that serializes to the API format. Closes SDK-101
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
Add user-friendly schema field type classes for defining index schemas with typed fields.
Closes SDK-101
Field Types
TextFieldstringfilterable,full_text_searchableIntegerFieldintegerfilterableFloatFieldfloatfilterableDenseVectorFielddense_vectordimension,metricSparseVectorFieldsparse_vectormetricSemanticTextFieldsemantic_textmodel,field_mapUsage Example
Test Plan
Notes
The unit tests use a workaround to load the schema_fields module directly, bypassing the broken import chain in db_control caused by the alpha API changes. This will be fixed in SDK-104/107.
Note
Low Risk
Low risk: this is additive API surface (new dataclasses + exports) with straightforward serialization logic and unit coverage; minimal chance of impacting existing behavior beyond import/export wiring.
Overview
Adds new schema field type helpers in
db_control/models/schema_fields.py(TextField,IntegerField,FloatField,DenseVectorField,SparseVectorField,SemanticTextField, plusSchemaField) that serialize viato_dict()into the API’s expected schema format.Exports these types through
pinecone.db_control.modelsand top-levelpineconevia lazy imports, and adds unit tests validating default values andto_dict()output for each field type (with a temporary direct-module-load workaround in the tests).Written by Cursor Bugbot for commit f8b8af6. This will update automatically on new commits. Configure here.