Skip to content

fix(s3_vectors): list() wraps results in an extra list, breaking callers#5333

Open
devteamaegis wants to merge 1 commit into
mem0ai:mainfrom
devteamaegis:fix/s3-vectors-list-double-wrapped
Open

fix(s3_vectors): list() wraps results in an extra list, breaking callers#5333
devteamaegis wants to merge 1 commit into
mem0ai:mainfrom
devteamaegis:fix/s3-vectors-list-double-wrapped

Conversation

@devteamaegis
Copy link
Copy Markdown

What's broken

S3VectorStore.list() returns List[List[OutputData]] instead of List[OutputData]:

store = S3VectorStore(...)
results = store.list()
# results is [[OutputData(...), OutputData(...)]]  ← nested list
# should be   [OutputData(...), OutputData(...)]

Any caller that iterates over the result gets a single inner list as the first element, not the actual records.

Why it happens

The return statement wraps _parse_output() in an extra list literal:

return [self._parse_output(all_vectors)]   # wrong

Every other vector store returns the list directly:

return self._parse_output(all_vectors)     # correct

Fix

Remove the outer [...].

Copy link
Copy Markdown

@biswajeetdev biswajeetdev left a comment

Choose a reason for hiding this comment

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

One-line fix, clearly correct. _parse_output returns a list, so wrapping it in [...] was producing a list-of-a-list — callers iterating over the result of list() would get a single element (the inner list) rather than the individual vectors.

Two small follow-up suggestions:

  1. Test coverage — this is a silent data shape bug that is easy to reintroduce. A unit test asserting that list() returns a flat list of vector objects (not a nested list) would lock in the fix.

  2. Parallel issue in other stores — worth a quick grep across the other vector store implementations (pinecone.py, chroma.py, etc.) to check if any have the same [self._parse_output(...)] pattern in their list() methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants