Skip to content

Commit b42de4e

Browse files
author
Joan Fontanals Martinez
committed
feat: remove JAC
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
1 parent 4ef4939 commit b42de4e

File tree

11 files changed

+11
-729
lines changed

11 files changed

+11
-729
lines changed

docarray/array/doc_list/pushpull.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from typing_extensions import Literal
1616
from typing_inspect import get_args
1717

18-
PUSH_PULL_PROTOCOL = Literal['jac', 's3', 'file']
18+
PUSH_PULL_PROTOCOL = Literal['s3', 'file']
1919
SUPPORTED_PUSH_PULL_PROTOCOLS = get_args(PUSH_PULL_PROTOCOL)
2020

2121
if TYPE_CHECKING: # pragma: no cover
@@ -55,18 +55,13 @@ def get_pushpull_backend(
5555
"""
5656
Get the backend for the given protocol.
5757
58-
:param protocol: the protocol to use, e.g. 'jac', 'file', 's3'
58+
:param protocol: the protocol to use, e.g. 'file', 's3'
5959
:return: the backend class
6060
"""
6161
if protocol in cls.__backends__:
6262
return cls.__backends__[protocol]
6363

64-
if protocol == 'jac':
65-
from docarray.store.jac import JACDocStore
66-
67-
cls.__backends__[protocol] = JACDocStore
68-
logging.debug('Loaded Jina AI Cloud backend')
69-
elif protocol == 'file':
64+
if protocol == 'file':
7065
from docarray.store.file import FileDocStore
7166

7267
cls.__backends__[protocol] = FileDocStore
@@ -84,45 +79,37 @@ def get_pushpull_backend(
8479
def push(
8580
self,
8681
url: str,
87-
public: bool = True,
8882
show_progress: bool = False,
89-
branding: Optional[Dict] = None,
83+
**kwargs,
9084
) -> Dict:
9185
"""Push this `DocList` object to the specified url.
9286
9387
:param url: url specifying the protocol and save name of the `DocList`. Should be of the form ``protocol://namespace/name``. e.g. ``s3://bucket/path/to/namespace/name``, ``file:///path/to/folder/name``
94-
:param public: Only used by ``jac`` protocol. If true, anyone can pull a `DocList` if they know its name.
95-
Setting this to false will restrict access to only the creator.
9688
:param show_progress: If true, a progress bar will be displayed.
97-
:param branding: Only used by ``jac`` protocol. A dictionary of branding information to be sent to Jina AI Cloud. {"icon": "emoji", "background": "#fff"}
9889
"""
9990
logging.info(f'Pushing {len(self)} docs to {url}')
10091
protocol, name = self.__class__.resolve_url(url)
10192
return self.__class__.get_pushpull_backend(protocol).push(
102-
self, name, public, show_progress, branding # type: ignore
93+
self, name, show_progress # type: ignore
10394
)
10495

10596
@classmethod
10697
def push_stream(
10798
cls: Type[SelfPushPullMixin],
10899
docs: Iterator['BaseDoc'],
109100
url: str,
110-
public: bool = True,
111101
show_progress: bool = False,
112-
branding: Optional[Dict] = None,
113102
) -> Dict:
114103
"""Push a stream of documents to the specified url.
115104
116105
:param docs: a stream of documents
117106
:param url: url specifying the protocol and save name of the `DocList`. Should be of the form ``protocol://namespace/name``. e.g. ``s3://bucket/path/to/namespace/name``, ``file:///path/to/folder/name``
118-
:param public: Only used by ``jac`` protocol. If true, anyone can pull a `DocList` if they know its name.
119107
:param show_progress: If true, a progress bar will be displayed.
120-
:param branding: Only used by ``jac`` protocol. A dictionary of branding information to be sent to Jina AI Cloud. {"icon": "emoji", "background": "#fff"}
121108
"""
122109
logging.info(f'Pushing stream to {url}')
123110
protocol, name = cls.resolve_url(url)
124111
return cls.get_pushpull_backend(protocol).push_stream(
125-
docs, name, public, show_progress, branding
112+
docs, name, show_progress
126113
)
127114

128115
@classmethod

docarray/store/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@
88
)
99

1010
if TYPE_CHECKING:
11-
from docarray.store.jac import JACDocStore # noqa: F401
1211
from docarray.store.s3 import S3DocStore # noqa: F401
1312

1413
__all__ = ['FileDocStore']
1514

1615

1716
def __getattr__(name: str):
1817
lib: types.ModuleType
19-
if name == 'JACDocStore':
20-
import_library('hubble', raise_error=True)
21-
import docarray.store.jac as lib
22-
elif name == 'S3DocStore':
18+
if name == 'S3DocStore':
2319
import_library('smart_open', raise_error=True)
2420
import_library('botocore', raise_error=True)
2521
import_library('boto3', raise_error=True)

docarray/store/abstract_doc_store.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,13 @@ def delete(name: str, missing_ok: bool) -> bool:
3535
def push(
3636
docs: 'DocList',
3737
name: str,
38-
public: bool,
3938
show_progress: bool,
40-
branding: Optional[Dict],
4139
) -> Dict:
4240
"""Push this DocList to the specified name.
4341
4442
:param docs: The DocList to push
4543
:param name: The name to push to
46-
:param public: Whether the DocList should be publicly accessible
4744
:param show_progress: If true, a progress bar will be displayed.
48-
:param branding: Branding information to be stored with the DocList
4945
"""
5046
...
5147

@@ -54,17 +50,13 @@ def push(
5450
def push_stream(
5551
docs: Iterator['BaseDoc'],
5652
url: str,
57-
public: bool = True,
5853
show_progress: bool = False,
59-
branding: Optional[Dict] = None,
6054
) -> Dict:
6155
"""Push a stream of documents to the specified name.
6256
6357
:param docs: a stream of documents
6458
:param url: The name to push to
65-
:param public: Whether the DocList should be publicly accessible
6659
:param show_progress: If true, a progress bar will be displayed.
67-
:param branding: Branding information to be stored with the DocList
6860
"""
6961
...
7062

docarray/store/file.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,14 @@ def push_stream(
117117
cls: Type[SelfFileDocStore],
118118
docs: Iterator['BaseDoc'],
119119
name: str,
120-
public: bool = True,
121120
show_progress: bool = False,
122-
branding: Optional[Dict] = None,
123121
) -> Dict:
124122
"""Push a stream of documents to the specified file path.
125123
126124
:param docs: a stream of documents
127125
:param name: The file path to push to.
128-
:param public: Not used by the ``file`` protocol.
129126
:param show_progress: If true, a progress bar will be displayed.
130-
:param branding: Not used by the ``file`` protocol.
131127
"""
132-
if branding is not None:
133-
logging.warning('branding is not supported for "file" protocol')
134-
135128
source = _to_binary_stream(
136129
docs, protocol='protobuf', compress='gzip', show_progress=show_progress
137130
)

0 commit comments

Comments
 (0)