Skip to content

Commit

Permalink
fix: bump rocksdb >= 0.3.9 (#225)
Browse files Browse the repository at this point in the history
* fix: bump rocksdb >= 0.3.9

* fix: ci env
  • Loading branch information
numb3r3 authored Apr 7, 2023
1 parent 3668c3f commit ab807ff
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ jobs:
cibw_arch: [ "auto64" ]
python-version: [ [ '3.7', "cp37-*" ] ]
test-path: ${{fromJson(needs.prep-testbed.outputs.matrix)}}
env:
JINA_HIDE_SURVEY: "1"
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ jobs:
python-version: [3.7]
cibw_arch: ["auto64"]
test-path: ${{fromJson(needs.prep-testbed.outputs.matrix)}}
env:
JINA_HIDE_SURVEY: "1"
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
Expand Down
8 changes: 4 additions & 4 deletions annlite/storage/kv.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _init_db(self, create_if_missing: bool = True, **kwargs):
def insert(self, docs: 'DocumentArray'):
write_batch = WriteBatch(raw_mode=True)
write_opt = WriteOptions()
write_opt.set_sync(True)
write_opt.sync = True
batch_size = 0
for doc in docs:
write_batch.put(doc.id.encode(), doc.to_bytes(**self._serialize_config))
Expand All @@ -64,7 +64,7 @@ def insert(self, docs: 'DocumentArray'):
def update(self, docs: 'DocumentArray'):
write_batch = WriteBatch(raw_mode=True)
write_opt = WriteOptions()
write_opt.set_sync(True)
write_opt.sync = True
for doc in docs:
key = doc.id.encode()
if key not in self._db:
Expand All @@ -76,7 +76,7 @@ def update(self, docs: 'DocumentArray'):
def delete(self, doc_ids: List[str]):
write_batch = WriteBatch(raw_mode=True)
write_opt = WriteOptions()
write_opt.set_sync(True)
write_opt.sync = True
for doc_id in doc_ids:
write_batch.delete(doc_id.encode())
self._db.write(write_batch, write_opt=write_opt)
Expand Down Expand Up @@ -139,7 +139,7 @@ def batched_iterator(self, batch_size: int = 1, **kwargs) -> 'DocumentArray':
count = 0
docs = DocumentArray()

read_opt = ReadOptions(raw_mode=True)
read_opt = ReadOptions()

for value in self._db.values(read_opt=read_opt):
doc = Document.from_bytes(value, **self._serialize_config)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ docarray[common]>=0.13.16
filesplit
loguru
numpy
rocksdict<=0.2.16
rocksdict>=0.3.9
scikit-learn

0 comments on commit ab807ff

Please sign in to comment.