Revert "Stop emitting experimental warnings"

This reverts commit 3daa32de4e.
pull/21954/head
Richard Belleville 5 years ago
parent ff3088979a
commit 7c581ab099
  1. 4
      src/python/grpcio/grpc/_simple_stubs.py
  2. 12
      src/python/grpcio/grpc/experimental/__init__.py

@ -228,6 +228,7 @@ def unary_unary(
Returns:
The response to the RPC.
"""
grpc.experimental.warn_experimental("unary_unary")
channel = ChannelCache.get().get_channel(target, options,
channel_credentials, compression)
multicallable = channel.unary_unary(method, request_serializer,
@ -298,6 +299,7 @@ def unary_stream(
Returns:
An iterator of responses.
"""
grpc.experimental.warn_experimental("unary_stream")
channel = ChannelCache.get().get_channel(target, options,
channel_credentials, compression)
multicallable = channel.unary_stream(method, request_serializer,
@ -368,6 +370,7 @@ def stream_unary(
Returns:
The response to the RPC.
"""
grpc.experimental.warn_experimental("stream_unary")
channel = ChannelCache.get().get_channel(target, options,
channel_credentials, compression)
multicallable = channel.stream_unary(method, request_serializer,
@ -438,6 +441,7 @@ def stream_stream(
Returns:
An iterator of responses.
"""
grpc.experimental.warn_experimental("stream_stream")
channel = ChannelCache.get().get_channel(target, options,
channel_credentials, compression)
multicallable = channel.stream_stream(method, request_serializer,

@ -17,6 +17,7 @@ These APIs are subject to be removed during any minor version release.
"""
import sys
import warnings
import grpc
@ -51,8 +52,19 @@ def insecure_channel_credentials():
return grpc.ChannelCredentials(_insecure_channel_credentials)
class ExperimentalApiWarning(Warning):
"""A warning that an API is experimental."""
def warn_experimental(api_name):
msg = ("{} is an experimental API. It is subject to change or ".format(
api_name) + "removal between minor releases. Proceed with caution.")
warnings.warn(msg, ExperimentalApiWarning, stacklevel=2)
__all__ = (
'ChannelOptions',
'ExperimentalApiWarning',
'UsageError',
'insecure_channel_credentials',
)

Loading…
Cancel
Save