Skip to content
Merged
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
2 changes: 1 addition & 1 deletion google/pubsub_v1/services/subscriber/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,7 @@ def request_generator():
# Wrappers in api-core should not automatically pre-fetch the first
# stream result, as this breaks the stream when re-opening it.
# https://github.com/googleapis/python-pubsub/issues/93#issuecomment-630762257
self._transport.streaming_pull._prefetch_first_result_ = False # type: ignore
self._transport.streaming_pull._prefetch_first_result_ = False

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand Down
5 changes: 2 additions & 3 deletions google/pubsub_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,12 @@
Encoding,
SchemaView,
)
import google.api_core.timeout

TimeoutType = Union[
int,
float,
google.api_core.timeout.ConstantTimeout,
google.api_core.timeout.ExponentialTimeout,
"google.api_core.timeout.ConstantTimeout",
"google.api_core.timeout.ExponentialTimeout",
]
"""The type of the timeout parameter of publisher client methods."""

Expand Down
58 changes: 33 additions & 25 deletions google/pubsub_v1/types/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@ class State(proto.Enum):
Permission denied encountered while consuming data from
Kinesis. This can happen if:

- The provided ``aws_role_arn`` does not exist or does not
have the appropriate permissions attached.
- The provided ``aws_role_arn`` is not set up properly for
Identity Federation using ``gcp_service_account``.
- The Pub/Sub SA is not granted the
``iam.serviceAccounts.getOpenIdToken`` permission on
``gcp_service_account``.
- The provided ``aws_role_arn`` does not exist or does not
have the appropriate permissions attached.
- The provided ``aws_role_arn`` is not set up properly for
Identity Federation using ``gcp_service_account``.
- The Pub/Sub SA is not granted the
``iam.serviceAccounts.getOpenIdToken`` permission on
``gcp_service_account``.
PUBLISH_PERMISSION_DENIED (3):
Permission denied encountered while publishing to the topic.
This can happen if the Pub/Sub SA has not been granted the
Expand Down Expand Up @@ -347,9 +347,9 @@ class State(proto.Enum):
granted the `appropriate
permissions <https://cloud.google.com/storage/docs/access-control/iam-permissions>`__:

- storage.objects.list: to list the objects in a bucket.
- storage.objects.get: to read the objects in a bucket.
- storage.buckets.get: to verify the bucket exists.
- storage.objects.list: to list the objects in a bucket.
- storage.objects.get: to read the objects in a bucket.
- storage.buckets.get: to verify the bucket exists.
PUBLISH_PERMISSION_DENIED (3):
Permission denied encountered while publishing to the topic.
This can happen if the Pub/Sub SA has not been granted the
Expand Down Expand Up @@ -1991,11 +1991,11 @@ class Subscription(proto.Message):
for the delivery of a message with a given value of
``message_id`` on this subscription:

- The message sent to a subscriber is guaranteed not to be
resent before the message's acknowledgment deadline
expires.
- An acknowledged message will not be resent to a
subscriber.
- The message sent to a subscriber is guaranteed not to be
resent before the message's acknowledgment deadline
expires.
- An acknowledged message will not be resent to a
subscriber.

Note that subscribers may still receive multiple copies of a
message when ``enable_exactly_once_delivery`` is true if the
Expand Down Expand Up @@ -2309,10 +2309,10 @@ class PushConfig(proto.Message):
The only supported values for the ``x-goog-version``
attribute are:

- ``v1beta1``: uses the push format defined in the v1beta1
Pub/Sub API.
- ``v1`` or ``v1beta2``: uses the push format defined in
the v1 Pub/Sub API.
- ``v1beta1``: uses the push format defined in the v1beta1
Pub/Sub API.
- ``v1`` or ``v1beta2``: uses the push format defined in the
v1 Pub/Sub API.

For example: ``attributes { "x-goog-version": "v1" }``
oidc_token (google.pubsub_v1.types.PushConfig.OidcToken):
Expand Down Expand Up @@ -2478,12 +2478,11 @@ class State(proto.Enum):
Cannot write to the BigQuery table because of permission
denied errors. This can happen if

- Pub/Sub SA has not been granted the `appropriate BigQuery
IAM
permissions <https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account>`__
- bigquery.googleapis.com API is not enabled for the
project
(`instructions <https://cloud.google.com/service-usage/docs/enable-disable>`__)
- Pub/Sub SA has not been granted the `appropriate BigQuery
IAM
permissions <https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account>`__
- bigquery.googleapis.com API is not enabled for the project
(`instructions <https://cloud.google.com/service-usage/docs/enable-disable>`__)
NOT_FOUND (3):
Cannot write to the BigQuery table because it
does not exist.
Expand Down Expand Up @@ -3111,6 +3110,11 @@ class StreamingPullRequest(proto.Message):
only be set on the initial StreamingPullRequest. If it is
set on a subsequent request, the stream will be aborted with
status ``INVALID_ARGUMENT``.
protocol_version (int):
Optional. The protocol version used by the client. This
property can only be set on the initial
StreamingPullRequest. If it is set on a subsequent request,
the stream will be aborted with status ``INVALID_ARGUMENT``.
"""

subscription: str = proto.Field(
Expand Down Expand Up @@ -3145,6 +3149,10 @@ class StreamingPullRequest(proto.Message):
proto.INT64,
number=8,
)
protocol_version: int = proto.Field(
proto.INT64,
number=10,
)


class StreamingPullResponse(proto.Message):
Expand Down
4 changes: 1 addition & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[mypy]
python_version = 3.8
python_version = 3.7
namespace_packages = True
# Autogenerated folder - TODO remove this https://github.com/googleapis/python-pubsub/issues/536
exclude = google/pubsub_v1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-pubsub",
"version": "2.31.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/fixup_pubsub_v1_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class pubsubCallTransformer(cst.CSTTransformer):
'pull': ('subscription', 'max_messages', 'return_immediately', ),
'rollback_schema': ('name', 'revision_id', ),
'seek': ('subscription', 'time', 'snapshot', ),
'streaming_pull': ('subscription', 'stream_ack_deadline_seconds', 'ack_ids', 'modify_deadline_seconds', 'modify_deadline_ack_ids', 'client_id', 'max_outstanding_messages', 'max_outstanding_bytes', ),
'streaming_pull': ('subscription', 'stream_ack_deadline_seconds', 'ack_ids', 'modify_deadline_seconds', 'modify_deadline_ack_ids', 'client_id', 'max_outstanding_messages', 'max_outstanding_bytes', 'protocol_version', ),
'update_snapshot': ('snapshot', 'update_mask', ),
'update_subscription': ('subscription', 'update_mask', ),
'update_topic': ('topic', 'update_mask', ),
Expand Down