Skip to content

Commit 3c194f7

Browse files
authored
Remove ABC interface classes and inline method docstrings (#572)
## Summary This PR removes ABC interface classes that were only used to store docstrings and moves all documentation directly to the implementation methods. This simplifies the codebase by eliminating unnecessary abstraction layers while preserving all documentation. ## Changes Made ### Removed Interface Classes - Deleted `pinecone/db_data/interfaces.py` (IndexInterface) - Deleted `pinecone/db_data/index_asyncio_interface.py` (IndexAsyncioInterface) - Deleted `pinecone/pinecone_interface_asyncio.py` (PineconeAsyncioDBControlInterface) ### Updated Implementation Classes - `pinecone/db_data/index.py` - Removed IndexInterface inheritance - `pinecone/db_data/index_asyncio.py` - Added docstrings to all methods, removed IndexAsyncioInterface inheritance - `pinecone/pinecone_asyncio.py` - Added docstrings to all methods, removed PineconeAsyncioDBControlInterface inheritance ## Why These Changes Were Made The ABC interface classes (`IndexInterface`, `IndexAsyncioInterface`, and `PineconeAsyncioDBControlInterface`) were serving no functional purpose beyond storing docstrings. They added unnecessary complexity to the codebase without providing any runtime benefits: - No type checking or enforcement (methods were already implemented) - No shared implementation (all methods were abstract with `pass`) - Documentation was the only content in these classes By inlining the docstrings directly into the implementation methods, we: - Reduce code complexity (net -1,503 lines) - Improve maintainability (documentation lives with implementation) - Eliminate unnecessary inheritance chains - Maintain full API documentation (all docstrings preserved) ## Implementation Details 1. **Docstring Migration**: All docstrings were moved from interface methods to their corresponding implementation methods, maintaining: - Full RST syntax compatibility (`.. code-block::`, `.. admonition::`, `:param:`, `:type:`, etc.) - All code examples and usage patterns - Parameter descriptions and return type documentation 2. **Import Cleanup**: Removed all imports of the interface classes from implementation files 3. **Inheritance Removal**: Removed interface class inheritance from: - `Index(PluginAware, IndexInterface)` → `Index(PluginAware)` - `_IndexAsyncio(IndexAsyncioInterface)` → `_IndexAsyncio` - `PineconeAsyncio(PineconeAsyncioDBControlInterface)` → `PineconeAsyncio` 4. **Verification**: - All docstrings verified for consistency with method implementations - Code examples validated for syntactic correctness - RST syntax verified for Sphinx compatibility - No linter errors introduced ## Impact - **Lines Changed**: -1,503 net lines (removed 3,240, added 1,737) - **Files Changed**: 6 files (3 deleted, 3 modified) - **Breaking Changes**: None - all public APIs remain unchanged - **Documentation**: Fully preserved - all docstrings maintained --- *This PR was generated with Vibe Kanban and Cursor.*
1 parent 94d5c7b commit 3c194f7

6 files changed

Lines changed: 1738 additions & 3241 deletions

File tree

pinecone/db_data/index.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
UpsertResponse,
3232
UpdateResponse,
3333
)
34-
from .interfaces import IndexInterface
3534
from .request_factory import IndexRequestFactory
3635
from .types import (
3736
SparseVectorTypedDict,
@@ -131,7 +130,7 @@ def __getattr__(self, name: str) -> Any:
131130
return getattr(self._apply_result, name)
132131

133132

134-
class Index(PluginAware, IndexInterface):
133+
class Index(PluginAware):
135134
"""
136135
A client for interacting with a Pinecone index via REST API.
137136
For improved performance, use the Pinecone GRPC index client.

0 commit comments

Comments
 (0)