fix: implement upsert_vector for MarqoVectorStoreDriver - #2254
Open
biconcavelens wants to merge 2 commits into
Open
biconcavelens wants to merge 2 commits into
biconcavelens wants to merge 2 commits into
Conversation
Marqo supports upserting arbitrary vectors via custom_vector fields, so this no longer needs to raise NotImplementedError. Closes griptape-ai#1802
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Describe your changes
MarqoVectorStoreDriver.upsert_vectorpreviously raisedNotImplementedError. Marqo supports upserting arbitrary vectors through custom vector fields, so this implements it:custom_vectormapping and upserts it viaadd_documents, mirroring the existingupsertmethod in the same driver (namespace/meta handling, response parsing, and returning the_id).Raises: ... not yet implementedline from the docstring.Note: unlike the
PineconeVectorStoreDriver,**kwargsis intentionally not forwarded toadd_documents, since Marqo'sadd_documentshas a fixed signature (no**kwargs) — this matches the existingupsertmethod in this driver.Issue ticket number and link
Closes #1802 — #1802
AI assistance disclosure (per CONTRIBUTING.md): this change was drafted with AI assistance. The implementation follows the pattern of the existing
upsertmethod and the issue author's suggested approach; I verifiedcustom_vectoris a valid Marqo mapping type and thatadd_documentsdoes not accept arbitrary kwargs against the pinnedmarqoversion, and confirmed the full driver test suite passes locally (pytest) withruff check/formatclean.