Skip to content

Commit bbac194

Browse files
authored
fix: use backend to determine annlite DocumentArray length (docarray#327)
* fix: len method annlite * fix: add again annlite in setup
1 parent 47e0a7c commit bbac194

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

docarray/array/storage/annlite/backend.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,6 @@ def __setstate__(self, state):
9898
from annlite import AnnLite
9999

100100
self._annlite = AnnLite(n_dim, lock=False, **filter_dict(config))
101+
102+
def __len__(self):
103+
return self._annlite.index_size

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
'qdrant': [
7272
'qdrant-client~=0.7.0',
7373
],
74+
'annlite': [
75+
'annlite>=0.3.0',
76+
],
7477
'test': [
7578
'pytest',
7679
'pytest-timeout',

0 commit comments

Comments
 (0)