Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docarray/array/mixins/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ def post(

:param host: a host string. Can be one of the following:
- `grpc://192.168.0.123:8080/endpoint`
- `websocket://192.168.0.123:8080/endpoint`
- `ws://192.168.0.123:8080/endpoint`
- `http://192.168.0.123:8080/endpoint`
- `jinahub://Hello/endpoint`
- `jinahub+docker://Hello/endpoint`
- `jinahub+sandbox://Hello/endpoint`

:param show_progress: if to show a progressbar
:param batch_size: number of Document on each request
:param parameters: parameters to send in the request
:return: the new DocumentArray returned from remote
"""

Expand Down Expand Up @@ -56,7 +57,7 @@ def post(
request_size=batch_size,
parameters=parameters,
)
elif r.scheme in ('grpc', 'http', 'websocket'):
elif r.scheme in ('grpc', 'http', 'ws'):
if _port is None:
raise ValueError(f'can not determine port from {host}')

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/array/mixins/test_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[
(dict(protocol='grpc'), 'grpc://127.0.0.1:$port/'),
(dict(protocol='grpc'), 'grpc://127.0.0.1:$port'),
(dict(protocol='websocket'), 'websocket://127.0.0.1:$port'),
(dict(protocol='websocket'), 'ws://127.0.0.1:$port'),
# (dict(protocol='http'), 'http://127.0.0.1:$port'), this somehow does not work on GH workflow
],
)
Expand Down