Skip to content

Commit 3380b3b

Browse files
authored
fix: ws scheme (#210)
1 parent db65167 commit 3380b3b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docarray/array/mixins/post.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ def post(
1818
1919
:param host: a host string. Can be one of the following:
2020
- `grpc://192.168.0.123:8080/endpoint`
21-
- `websocket://192.168.0.123:8080/endpoint`
21+
- `ws://192.168.0.123:8080/endpoint`
2222
- `http://192.168.0.123:8080/endpoint`
2323
- `jinahub://Hello/endpoint`
2424
- `jinahub+docker://Hello/endpoint`
2525
- `jinahub+sandbox://Hello/endpoint`
2626
2727
:param show_progress: if to show a progressbar
2828
:param batch_size: number of Document on each request
29+
:param parameters: parameters to send in the request
2930
:return: the new DocumentArray returned from remote
3031
"""
3132

@@ -56,7 +57,7 @@ def post(
5657
request_size=batch_size,
5758
parameters=parameters,
5859
)
59-
elif r.scheme in ('grpc', 'http', 'websocket'):
60+
elif r.scheme in ('grpc', 'http', 'ws'):
6061
if _port is None:
6162
raise ValueError(f'can not determine port from {host}')
6263

tests/unit/array/mixins/test_post.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[
1313
(dict(protocol='grpc'), 'grpc://127.0.0.1:$port/'),
1414
(dict(protocol='grpc'), 'grpc://127.0.0.1:$port'),
15-
(dict(protocol='websocket'), 'websocket://127.0.0.1:$port'),
15+
(dict(protocol='websocket'), 'ws://127.0.0.1:$port'),
1616
# (dict(protocol='http'), 'http://127.0.0.1:$port'), this somehow does not work on GH workflow
1717
],
1818
)

0 commit comments

Comments
 (0)