diff --git a/.release-please-manifest.json b/.release-please-manifest.json index db87e5c90..8028c14b5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,4 +1,4 @@ { - ".": "2.29.1" + ".": "2.30.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1435f6752..7a9265758 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ [1]: https://pypi.org/project/google-cloud-pubsub/#history +## [2.30.0](https://github.com/googleapis/python-pubsub/compare/v2.29.1...v2.30.0) (2025-06-07) + + +### Features + +* Add SchemaViolationReason to IngestionFailureEvent ([#1411](https://github.com/googleapis/python-pubsub/issues/1411)) ([c046ca2](https://github.com/googleapis/python-pubsub/commit/c046ca22e9bddff6b50f7670bf6b9b9470bf78e8)) + ## [2.29.1](https://github.com/googleapis/python-pubsub/compare/v2.29.0...v2.29.1) (2025-05-23) diff --git a/google/pubsub/gapic_version.py b/google/pubsub/gapic_version.py index f62042190..5ebb3bec4 100644 --- a/google/pubsub/gapic_version.py +++ b/google/pubsub/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.29.1" # {x-release-please-version} +__version__ = "2.30.0" # {x-release-please-version} diff --git a/google/pubsub_v1/gapic_version.py b/google/pubsub_v1/gapic_version.py index f62042190..5ebb3bec4 100644 --- a/google/pubsub_v1/gapic_version.py +++ b/google/pubsub_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.29.1" # {x-release-please-version} +__version__ = "2.30.0" # {x-release-please-version} diff --git a/google/pubsub_v1/services/subscriber/async_client.py b/google/pubsub_v1/services/subscriber/async_client.py index 5d3dd3da7..77f96d6df 100644 --- a/google/pubsub_v1/services/subscriber/async_client.py +++ b/google/pubsub_v1/services/subscriber/async_client.py @@ -1377,7 +1377,7 @@ def streaming_pull( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> Awaitable[AsyncIterable[pubsub.StreamingPullResponse]]: r"""Establishes a stream with the server, which sends messages down - to the client. The client streams acknowledgements and ack + to the client. The client streams acknowledgments and ack deadline modifications back to the server. The server will close the stream and return the status on any error. The server may close the stream with status ``UNAVAILABLE`` to reassign @@ -1427,7 +1427,7 @@ def request_generator(): requests (AsyncIterator[`google.pubsub_v1.types.StreamingPullRequest`]): The request object AsyncIterator. Request for the ``StreamingPull`` streaming RPC method. This request is used to establish the initial stream as - well as to stream acknowledgements and ack deadline + well as to stream acknowledgments and ack deadline modifications from the client to the server. retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. diff --git a/google/pubsub_v1/services/subscriber/client.py b/google/pubsub_v1/services/subscriber/client.py index eef3ab77d..ff7edf538 100644 --- a/google/pubsub_v1/services/subscriber/client.py +++ b/google/pubsub_v1/services/subscriber/client.py @@ -1827,7 +1827,7 @@ def streaming_pull( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> Iterable[pubsub.StreamingPullResponse]: r"""Establishes a stream with the server, which sends messages down - to the client. The client streams acknowledgements and ack + to the client. The client streams acknowledgments and ack deadline modifications back to the server. The server will close the stream and return the status on any error. The server may close the stream with status ``UNAVAILABLE`` to reassign @@ -1877,7 +1877,7 @@ def request_generator(): requests (Iterator[google.pubsub_v1.types.StreamingPullRequest]): The request object iterator. Request for the ``StreamingPull`` streaming RPC method. This request is used to establish the initial stream as - well as to stream acknowledgements and ack deadline + well as to stream acknowledgments and ack deadline modifications from the client to the server. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. diff --git a/google/pubsub_v1/services/subscriber/transports/grpc.py b/google/pubsub_v1/services/subscriber/transports/grpc.py index ec400da0c..36c77648b 100644 --- a/google/pubsub_v1/services/subscriber/transports/grpc.py +++ b/google/pubsub_v1/services/subscriber/transports/grpc.py @@ -571,7 +571,7 @@ def streaming_pull( r"""Return a callable for the streaming pull method over gRPC. Establishes a stream with the server, which sends messages down - to the client. The client streams acknowledgements and ack + to the client. The client streams acknowledgments and ack deadline modifications back to the server. The server will close the stream and return the status on any error. The server may close the stream with status ``UNAVAILABLE`` to reassign diff --git a/google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py b/google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py index 04576b587..78f8afd4c 100644 --- a/google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py +++ b/google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py @@ -585,7 +585,7 @@ def streaming_pull( r"""Return a callable for the streaming pull method over gRPC. Establishes a stream with the server, which sends messages down - to the client. The client streams acknowledgements and ack + to the client. The client streams acknowledgments and ack deadline modifications back to the server. The server will close the stream and return the status on any error. The server may close the stream with status ``UNAVAILABLE`` to reassign diff --git a/google/pubsub_v1/types/pubsub.py b/google/pubsub_v1/types/pubsub.py index 6f27edfee..dcc25bb31 100644 --- a/google/pubsub_v1/types/pubsub.py +++ b/google/pubsub_v1/types/pubsub.py @@ -827,6 +827,11 @@ class IngestionFailureEvent(proto.Message): Optional. Failure when ingesting from Confluent Cloud. + This field is a member of `oneof`_ ``failure``. + aws_kinesis_failure (google.pubsub_v1.types.IngestionFailureEvent.AwsKinesisFailureReason): + Optional. Failure when ingesting from AWS + Kinesis. + This field is a member of `oneof`_ ``failure``. """ @@ -850,6 +855,12 @@ class AvroFailureReason(proto.Message): """ + class SchemaViolationReason(proto.Message): + r"""Set when a Pub/Sub message fails to get published due to a + schema validation violation. + + """ + class CloudStorageFailure(proto.Message): r"""Failure when ingesting from a Cloud Storage source. @@ -881,6 +892,11 @@ class CloudStorageFailure(proto.Message): Optional. The Pub/Sub API limits prevented the desired message from being published. + This field is a member of `oneof`_ ``reason``. + schema_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.SchemaViolationReason): + Optional. The Pub/Sub message failed schema + validation. + This field is a member of `oneof`_ ``reason``. """ @@ -908,10 +924,23 @@ class CloudStorageFailure(proto.Message): oneof="reason", message="IngestionFailureEvent.ApiViolationReason", ) + schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( + proto.Field( + proto.MESSAGE, + number=7, + oneof="reason", + message="IngestionFailureEvent.SchemaViolationReason", + ) + ) class AwsMskFailureReason(proto.Message): r"""Failure when ingesting from an Amazon MSK source. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: @@ -931,6 +960,11 @@ class AwsMskFailureReason(proto.Message): Optional. The Pub/Sub API limits prevented the desired message from being published. + This field is a member of `oneof`_ ``reason``. + schema_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.SchemaViolationReason): + Optional. The Pub/Sub message failed schema + validation. + This field is a member of `oneof`_ ``reason``. """ @@ -956,10 +990,23 @@ class AwsMskFailureReason(proto.Message): oneof="reason", message="IngestionFailureEvent.ApiViolationReason", ) + schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( + proto.Field( + proto.MESSAGE, + number=6, + oneof="reason", + message="IngestionFailureEvent.SchemaViolationReason", + ) + ) class AzureEventHubsFailureReason(proto.Message): r"""Failure when ingesting from an Azure Event Hubs source. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: @@ -979,6 +1026,11 @@ class AzureEventHubsFailureReason(proto.Message): Optional. The Pub/Sub API limits prevented the desired message from being published. + This field is a member of `oneof`_ ``reason``. + schema_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.SchemaViolationReason): + Optional. The Pub/Sub message failed schema + validation. + This field is a member of `oneof`_ ``reason``. """ @@ -1004,10 +1056,23 @@ class AzureEventHubsFailureReason(proto.Message): oneof="reason", message="IngestionFailureEvent.ApiViolationReason", ) + schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( + proto.Field( + proto.MESSAGE, + number=6, + oneof="reason", + message="IngestionFailureEvent.SchemaViolationReason", + ) + ) class ConfluentCloudFailureReason(proto.Message): r"""Failure when ingesting from a Confluent Cloud source. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: @@ -1027,6 +1092,11 @@ class ConfluentCloudFailureReason(proto.Message): Optional. The Pub/Sub API limits prevented the desired message from being published. + This field is a member of `oneof`_ ``reason``. + schema_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.SchemaViolationReason): + Optional. The Pub/Sub message failed schema + validation. + This field is a member of `oneof`_ ``reason``. """ @@ -1052,6 +1122,57 @@ class ConfluentCloudFailureReason(proto.Message): oneof="reason", message="IngestionFailureEvent.ApiViolationReason", ) + schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( + proto.Field( + proto.MESSAGE, + number=6, + oneof="reason", + message="IngestionFailureEvent.SchemaViolationReason", + ) + ) + + class AwsKinesisFailureReason(proto.Message): + r"""Failure when ingesting from an AWS Kinesis source. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + stream_arn (str): + Optional. The stream ARN of the Kinesis + stream being ingested from. + partition_key (str): + Optional. The partition key of the message + that failed to be ingested. + sequence_number (str): + Optional. The sequence number of the message + that failed to be ingested. + schema_violation_reason (google.pubsub_v1.types.IngestionFailureEvent.SchemaViolationReason): + Optional. The Pub/Sub message failed schema + validation. + + This field is a member of `oneof`_ ``reason``. + """ + + stream_arn: str = proto.Field( + proto.STRING, + number=1, + ) + partition_key: str = proto.Field( + proto.STRING, + number=2, + ) + sequence_number: str = proto.Field( + proto.STRING, + number=3, + ) + schema_violation_reason: "IngestionFailureEvent.SchemaViolationReason" = ( + proto.Field( + proto.MESSAGE, + number=4, + oneof="reason", + message="IngestionFailureEvent.SchemaViolationReason", + ) + ) topic: str = proto.Field( proto.STRING, @@ -1085,6 +1206,12 @@ class ConfluentCloudFailureReason(proto.Message): oneof="failure", message=ConfluentCloudFailureReason, ) + aws_kinesis_failure: AwsKinesisFailureReason = proto.Field( + proto.MESSAGE, + number=7, + oneof="failure", + message=AwsKinesisFailureReason, + ) class JavaScriptUDF(proto.Message): @@ -1784,8 +1911,8 @@ class Subscription(proto.Message): This generally implies that messages will be retried as soon as possible for healthy subscribers. RetryPolicy will be triggered on - NACKs or acknowledgement deadline exceeded - events for a given message. + NACKs or acknowledgment deadline exceeded events + for a given message. detached (bool): Optional. Indicates whether the subscription is detached from its topic. Detached subscriptions don't receive @@ -1799,7 +1926,7 @@ class Subscription(proto.Message): ``message_id`` on this subscription: - The message sent to a subscriber is guaranteed not to be - resent before the message's acknowledgement deadline + resent before the message's acknowledgment deadline expires. - An acknowledged message will not be resent to a subscriber. @@ -1977,7 +2104,7 @@ class RetryPolicy(proto.Message): Retry delay will be exponential based on provided minimum and maximum backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. - RetryPolicy will be triggered on NACKs or acknowledgement deadline + RetryPolicy will be triggered on NACKs or acknowledgment deadline exceeded events for a given message. Retry Policy is implemented on a best effort basis. At times, the @@ -2037,7 +2164,7 @@ class DeadLetterPolicy(proto.Message): message. The value must be between 5 and 100. The number of delivery attempts is defined as 1 + (the sum - of number of NACKs and number of times the acknowledgement + of number of NACKs and number of times the acknowledgment deadline has been exceeded for the message). A NACK is any call to ModifyAckDeadline with a 0 deadline. @@ -2386,7 +2513,7 @@ class CloudStorageConfig(proto.Message): elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription's - acknowledgement deadline. + acknowledgment deadline. max_bytes (int): Optional. The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 @@ -2838,7 +2965,7 @@ class AcknowledgeRequest(proto.Message): class StreamingPullRequest(proto.Message): r"""Request for the ``StreamingPull`` streaming RPC method. This request is used to establish the initial stream as well as to stream - acknowledgements and ack deadline modifications from the client to + acknowledgments and ack deadline modifications from the client to the server. Attributes: @@ -2849,12 +2976,12 @@ class StreamingPullRequest(proto.Message): client to server. Format is ``projects/{project}/subscriptions/{sub}``. ack_ids (MutableSequence[str]): - Optional. List of acknowledgement IDs for acknowledging + Optional. List of acknowledgment IDs for acknowledging previously received messages (received on this stream or a different stream). If an ack ID has expired, the corresponding message may be redelivered later. Acknowledging a message more than once will not result in an - error. If the acknowledgement ID is malformed, the stream + error. If the acknowledgment ID is malformed, the stream will be aborted with status ``INVALID_ARGUMENT``. modify_deadline_seconds (MutableSequence[int]): Optional. The list of new ack deadlines for the IDs listed @@ -2872,7 +2999,7 @@ class StreamingPullRequest(proto.Message): request. If the value is < 0 (an error), the stream will be aborted with status ``INVALID_ARGUMENT``. modify_deadline_ack_ids (MutableSequence[str]): - Optional. List of acknowledgement IDs whose deadline will be + Optional. List of acknowledgment IDs whose deadline will be modified based on the corresponding element in ``modify_deadline_seconds``. This field can be used to indicate that more time is needed to process a message by @@ -2974,22 +3101,22 @@ class StreamingPullResponse(proto.Message): """ class AcknowledgeConfirmation(proto.Message): - r"""Acknowledgement IDs sent in one or more previous requests to + r"""Acknowledgment IDs sent in one or more previous requests to acknowledge a previously received message. Attributes: ack_ids (MutableSequence[str]): Optional. Successfully processed - acknowledgement IDs. + acknowledgment IDs. invalid_ack_ids (MutableSequence[str]): - Optional. List of acknowledgement IDs that - were malformed or whose acknowledgement deadline + Optional. List of acknowledgment IDs that + were malformed or whose acknowledgment deadline has expired. unordered_ack_ids (MutableSequence[str]): - Optional. List of acknowledgement IDs that + Optional. List of acknowledgment IDs that were out of order. temporary_failed_ack_ids (MutableSequence[str]): - Optional. List of acknowledgement IDs that + Optional. List of acknowledgment IDs that failed processing with temporary issues. """ @@ -3011,19 +3138,19 @@ class AcknowledgeConfirmation(proto.Message): ) class ModifyAckDeadlineConfirmation(proto.Message): - r"""Acknowledgement IDs sent in one or more previous requests to + r"""Acknowledgment IDs sent in one or more previous requests to modify the deadline for a specific message. Attributes: ack_ids (MutableSequence[str]): Optional. Successfully processed - acknowledgement IDs. + acknowledgment IDs. invalid_ack_ids (MutableSequence[str]): - Optional. List of acknowledgement IDs that - were malformed or whose acknowledgement deadline + Optional. List of acknowledgment IDs that + were malformed or whose acknowledgment deadline has expired. temporary_failed_ack_ids (MutableSequence[str]): - Optional. List of acknowledgement IDs that + Optional. List of acknowledgment IDs that failed processing with temporary issues. """ diff --git a/samples/generated_samples/snippet_metadata_google.pubsub.v1.json b/samples/generated_samples/snippet_metadata_google.pubsub.v1.json index dbb835bb3..28ac15bef 100644 --- a/samples/generated_samples/snippet_metadata_google.pubsub.v1.json +++ b/samples/generated_samples/snippet_metadata_google.pubsub.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-pubsub", - "version": "2.29.1" + "version": "2.30.0" }, "snippets": [ {