diff --git a/docarray/array/mixins/post.py b/docarray/array/mixins/post.py index a8b8bce0333..3a8932822c0 100644 --- a/docarray/array/mixins/post.py +++ b/docarray/array/mixins/post.py @@ -18,7 +18,7 @@ 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` @@ -26,6 +26,7 @@ def post( :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 """ @@ -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}') diff --git a/tests/unit/array/mixins/test_post.py b/tests/unit/array/mixins/test_post.py index 51dcee43f7c..55e817cd387 100644 --- a/tests/unit/array/mixins/test_post.py +++ b/tests/unit/array/mixins/test_post.py @@ -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 ], )