fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
MIT License
10.36k stars 497 forks source link

Support for PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION #356

Open Bec-k opened 1 year ago

Bec-k commented 1 year ago

In our code, we use os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python" Because of this, float arrays sent with grpcurl are converted into double, i could be wrong on this. In any case, adding this extra casting code is solving that, but still, it would be better if we could provide additional option to how grpcurl would handle casting implementation.

    arr = np.array(request.user_ids)
    user_ids = arr.astype(np.float)
Bec-k commented 1 year ago

As we use grpcurl for debugging purpose, we have to add that extra casting lines into our grpc handlers, because in production we don't need extra casting.