Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PubSub: Make synth operations on PubSub types idempotent #8447

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions pubsub/google/cloud/pubsub_v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,72 +104,6 @@
)


if sys.version_info >= (3, 5):
FlowControl.__doc__ = (
"The settings for controlling the rate at which messages are pulled "
"with an asynchronous subscription."
)
FlowControl.max_bytes.__doc__ = (
"The maximum total size of received - but not yet processed - messages "
"before pausing the message stream."
)
FlowControl.max_messages.__doc__ = (
"The maximum number of received - but not yet processed - messages before "
"pausing the message stream."
)
FlowControl.resume_threshold.__doc__ = (
"The relative threshold of the ``max_bytes`` and ``max_messages`` limits "
"below which to resume the message stream. Must be a positive number not "
"greater than ``1.0``."
)
FlowControl.max_requests.__doc__ = "Currently not in use."
FlowControl.max_request_batch_size.__doc__ = (
"The maximum number of requests scheduled by callbacks to process and "
"dispatch at a time."
)
FlowControl.max_request_batch_latency.__doc__ = (
"The maximum amount of time in seconds to wait for additional request "
"items before processing the next batch of requests."
)
FlowControl.max_lease_duration.__doc__ = (
"The maximum amount of time in seconds to hold a lease on a message "
"before dropping it from the lease management."
)


if sys.version_info >= (3, 5):
FlowControl.__doc__ = (
"The settings for controlling the rate at which messages are pulled "
"with an asynchronous subscription."
)
FlowControl.max_bytes.__doc__ = (
"The maximum total size of received - but not yet processed - messages "
"before pausing the message stream."
)
FlowControl.max_messages.__doc__ = (
"The maximum number of received - but not yet processed - messages before "
"pausing the message stream."
)
FlowControl.resume_threshold.__doc__ = (
"The relative threshold of the ``max_bytes`` and ``max_messages`` limits "
"below which to resume the message stream. Must be a positive number not "
"greater than ``1.0``."
)
FlowControl.max_requests.__doc__ = "Currently not in use."
FlowControl.max_request_batch_size.__doc__ = (
"The maximum number of requests scheduled by callbacks to process and "
"dispatch at a time."
)
FlowControl.max_request_batch_latency.__doc__ = (
"The maximum amount of time in seconds to wait for additional request "
"items before processing the next batch of requests."
)
FlowControl.max_lease_duration.__doc__ = (
"The maximum amount of time in seconds to hold a lease on a message "
"before dropping it from the lease management."
)


_shared_modules = [
http_pb2,
iam_policy_pb2,
Expand Down
10 changes: 5 additions & 5 deletions pubsub/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-06-19T12:19:44.898368Z",
"updateTime": "2019-06-20T13:51:18.842985Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.28.0",
"dockerImage": "googleapis/artman@sha256:6ced5a36b08b82a328c69844e629300d58c14067f25cadab47f52542bdef7daf"
"version": "0.29.0",
"dockerImage": "googleapis/artman@sha256:b79c8c20ee51e5302686c9d1294672d59290df1489be93749ef17d0172cc508d"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "ac13167e31a20314aa05cc9911c95df250880485",
"internalRef": "253867808"
"sha": "45e125f9e30dc5d45b52752b3ab78dd4f6084f2d",
"internalRef": "254026509"
}
},
{
Expand Down
14 changes: 14 additions & 0 deletions pubsub/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,20 @@ def _merge_dict(d1, d2):
)

# document FlowControl settings in Python 3.5+

# ... first remove any existing code that injects the docs
s.replace(
"google/cloud/pubsub_v1/types.py",
r"if sys\.version_info >= \(3, 5\):",
"",
)
s.replace(
"google/cloud/pubsub_v1/types.py",
r" FlowControl\..*?__doc__ = \(.*?\)",
"",
flags=re.DOTALL,
)

s.replace(
"google/cloud/pubsub_v1/types.py",
"FlowControl.__new__.__defaults__ = \(.*?\)",
Expand Down