Fix AttributeError when deleting vectors in asyncio mode #610
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
Fixes #564
The asyncio SDK was throwing
AttributeError: 'str' object has no attribute '_response_info'when attempting to delete vectors. This bug prevented the use of asyncio delete operations.Root Cause
The delete operation returns a simple string response, but the API client code assumed all non-dict responses were OpenAPI model objects that support dynamic attribute assignment via
setattr().The problematic code:
Solution
Added type checking to skip primitive types that don't support
setattr():Changes
setattr()Testing
Reproduction Script (from issue #564):
Expected Behavior: Delete completes successfully without errors
Actual Behavior (before fix):
AttributeError: 'str' object has no attribute '_response_info'Actual Behavior (after fix): Delete succeeds
Impact
Environment
Note
Low Risk
Small, localized change to response post-processing that only adds a type guard around
setattr(); low risk aside from slightly reduced_response_infoattachment on primitive return types.Overview
Prevents
AttributeErrorwhen endpoints return primitive types (e.g.,str) by skipping_response_infoattachment viasetattr()for non-model responses.Applies the same primitive-type guard in both
asyncio_api_client.pyandapi_client.py, while preserving_response_infoinjection fordictresponses and OpenAPI model objects.Written by Cursor Bugbot for commit bdc4bba. This will update automatically on new commits. Configure here.