From 68ac9447d8739a5e3038b23c2cb63a298acbc494 Mon Sep 17 00:00:00 2001 From: Johannes Messner Date: Mon, 22 Aug 2022 16:50:09 +0200 Subject: [PATCH 1/2] fix: update offset2id when deleting in subindex --- docarray/array/storage/base/getsetdel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docarray/array/storage/base/getsetdel.py b/docarray/array/storage/base/getsetdel.py index 00189ecf82c..1393dbc8ffe 100644 --- a/docarray/array/storage/base/getsetdel.py +++ b/docarray/array/storage/base/getsetdel.py @@ -146,7 +146,7 @@ def _update_subindices_del(self, ids): if getattr(self, '_subindices', None): for selector, da in self._subindices.items(): ids_subindex = DocumentArray(self[ids])[selector, 'id'] - da._del_docs_by_ids(ids_subindex) + da._del_docs(ids_subindex) def _del_docs(self, ids): self._del_docs_by_ids(ids) From c68e76054a66df5a7ced59d5b2858b7910180b18 Mon Sep 17 00:00:00 2001 From: Johannes Messner Date: Mon, 22 Aug 2022 17:10:18 +0200 Subject: [PATCH 2/2] refactor: use pythonic deletion --- docarray/array/storage/base/getsetdel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docarray/array/storage/base/getsetdel.py b/docarray/array/storage/base/getsetdel.py index 1393dbc8ffe..ab49d0f4e22 100644 --- a/docarray/array/storage/base/getsetdel.py +++ b/docarray/array/storage/base/getsetdel.py @@ -146,7 +146,7 @@ def _update_subindices_del(self, ids): if getattr(self, '_subindices', None): for selector, da in self._subindices.items(): ids_subindex = DocumentArray(self[ids])[selector, 'id'] - da._del_docs(ids_subindex) + del da[ids_subindex] def _del_docs(self, ids): self._del_docs_by_ids(ids)