GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: milvus _get_docs_by_ids (#859) · docarray/docarray@67209b8

This repository was archived by the owner on Sep 9, 2026. It is now read-only.

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • docarray/array/storage/milvus
    • getsetdel.py
  • tests/unit/array
    • test_advance_indexing.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docarray/array/storage/milvus/getsetdel.py‎

Copy file name to clipboardExpand all lines: docarray/array/storage/milvus/getsetdel.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ def _get_docs_by_ids(self, ids: 'Iterable[str]', **kwargs) -> 'DocumentArray':
7474
raise KeyError(f'No documents found for ids {ids}')
7575
docs.extend(self._docs_from_query_response(res))
7676
# sort output docs according to input id sorting
77-
id_to_index = {id_: i for i, id_ in enumerate(ids)}
78-
return DocumentArray(sorted(docs, key=lambda d: id_to_index[d.id]))
77+
return DocumentArray([docs[d] for d in ids])
7978

8079
def _del_docs_by_ids(self, ids: 'Iterable[str]', **kwargs) -> 'DocumentArray':
8180
kwargs = self._update_kwargs_from_config('consistency_level', **kwargs)
Collapse file

‎tests/unit/array/test_advance_indexing.py‎

Copy file name to clipboardExpand all lines: tests/unit/array/test_advance_indexing.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,13 @@ def test_sequence_str(docs, storage, config, start_storage):
273273
else:
274274
docs = DocumentArray(docs, storage=storage)
275275
# getter
276-
idx = [d.id for d in docs[1, 3, 5, 7, -1, -2]]
276+
idx = [d.id for d in docs[1, 3, 5, 7, -1, -2, 1]]
277277

278278
assert len(docs[idx]) == len(idx)
279279
assert len(docs[tuple(idx)]) == len(idx)
280280

281281
# setter
282+
idx = [d.id for d in docs[1, 3, 5, 7, -1, -2]]
282283
docs[idx] = [Document(text='repl') for _ in range(len(idx))]
283284
idx = [d.id for d in docs[1, 3, 5, 7, -1, -2]]
284285
for _id in idx:

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.