flower
flower copied to clipboard
Typing error expanding `grpc_client_proxy_test.py`
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]]"
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)
)