Skip to content

Commit 96ef235

Browse files
authored
RSDK-7393 - remove references to do_command from mlmodel service (#604)
1 parent 7b34a10 commit 96ef235

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

src/viam/services/mlmodel/client.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
from typing import Dict, Mapping, Optional
1+
from typing import Dict, Optional
22

33
from grpclib.client import Channel
44
from numpy.typing import NDArray
55

6-
from viam.proto.common import DoCommandRequest, DoCommandResponse
76
from viam.proto.service.mlmodel import InferRequest, InferResponse, MetadataRequest, MetadataResponse, MLModelServiceStub
87
from viam.resource.rpc_client_base import ReconfigurableResourceRPCClientBase
98
from viam.services.mlmodel.utils import flat_tensors_to_ndarrays, ndarrays_to_flat_tensors
10-
from viam.utils import ValueTypes, dict_to_struct, struct_to_dict
119

1210
from .mlmodel import Metadata, MLModel
1311

@@ -27,8 +25,3 @@ async def metadata(self, *, timeout: Optional[float] = None) -> Metadata:
2725
request = MetadataRequest(name=self.name)
2826
response: MetadataResponse = await self.client.Metadata(request)
2927
return response.metadata
30-
31-
async def do_command(self, command: Mapping[str, ValueTypes], *, timeout: Optional[float] = None, **kwargs) -> Mapping[str, ValueTypes]:
32-
request = DoCommandRequest(name=self.name, command=dict_to_struct(command))
33-
response: DoCommandResponse = await self.client.DoCommand(request, timeout=timeout)
34-
return struct_to_dict(response.result)

tests/test_mlmodel.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ async def test_metadata(self):
2323
resp = await self.mlmodel.metadata()
2424
assert resp == MockMLModel.META
2525

26-
@pytest.mark.asyncio
27-
async def do_command(self):
28-
command = {"command": "args"}
29-
resp = await self.mlmodel.do_command(command)
30-
assert resp == {"command": command}
31-
3226

3327
class TestService:
3428
@classmethod

0 commit comments

Comments
 (0)