flower icon indicating copy to clipboard operation
flower copied to clipboard

Typing error expanding `grpc_client_proxy_test.py`

Open pedropgusmao opened this issue 3 years ago • 1 comments

In the file src/py/flwr/server/grpc_server/grpc_client_proxy_test.py a ClientMessage.FitRes cannot accept a metrics parameter.

src/py/flwr/server/grpc_server/grpc_client_proxy_test.py:37: error: Argument "metrics" to "FitRes" has incompatible type "Dict[str, Union[bool, bytes, float, int, str]]"; expected "Optional[Mapping[str, Scalar]]"

pedropgusmao avatar Sep 10 '21 11:09 pedropgusmao

The original problem is when we try to assign Dict[str, Scalar] to ClientMessages in general as seen below. Apparently there typing.Mapping is how protobuf translates map messages and it is having issues converting Dict.

CLIENT_PROPERTIES: Properties= {"tensor_str": "numpy.ndarray"}
MESSAGE_PROPERTIES_RES = ClientMessage(
    properties_res=ClientMessage.PropertiesRes(properties=CLIENT_PROPERTIES)
)

pedropgusmao avatar Sep 10 '21 14:09 pedropgusmao