Skip to content

Commit

Permalink
feat: add sqlite storage backend (#69)
Browse files Browse the repository at this point in the history
Co-authored-by: Alaeddine Abdessalem <[email protected]>
Co-authored-by: David Buchaca Prats <[email protected]>
  • Loading branch information
3 people authored Jan 25, 2022
1 parent 4c81e6d commit ab788b2
Show file tree
Hide file tree
Showing 31 changed files with 1,455 additions and 503 deletions.
19 changes: 0 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
repos:
- repo: https://github.com/terrencepreilly/darglint
rev: v1.5.8
hooks:
- id: darglint
files: docarray/
exclude: ^(docarray/proto/docarray_pb2.py|docs/|docarray/resources/)
args:
- --message-template={path}:{line} {msg_id} {msg}
- -s=sphinx
- -z=full
- -v=2
- repo: https://github.com/pycqa/pydocstyle
rev: 5.1.1 # pick a git hash / tag to point to
hooks:
- id: pydocstyle
files: docarray/
exclude: ^(docarray/proto/docarray_pb2.py|docs/|docarray/resources/)
args:
- --select=D101,D102,D103
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
Expand Down
2 changes: 1 addition & 1 deletion docarray/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.4.5'
__version__ = '0.5.0'

from .document import Document
from .array import DocumentArray
9 changes: 9 additions & 0 deletions docarray/array/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from typing import MutableSequence

from .. import Document


class BaseDocumentArray(MutableSequence[Document]):
def __init__(self, *args, storage: str = 'memory', **kwargs):
super().__init__()
self._init_storage(*args, **kwargs)
3 changes: 2 additions & 1 deletion docarray/array/chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
)

from .document import DocumentArray
from .memory import DocumentArrayInMemory

if TYPE_CHECKING:
from ..document import Document


class ChunkArray(DocumentArray):
class ChunkArray(DocumentArrayInMemory):
"""
:class:`ChunkArray` inherits from :class:`DocumentArray`.
It's a subset of Documents.
Expand Down
Loading

0 comments on commit ab788b2

Please sign in to comment.