Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-google-api-core for openSUSE:Factory checked in at 2024-07-01 11:20:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-google-api-core (Old) and /work/SRC/openSUSE:Factory/.python-google-api-core.new.18349 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-google-api-core" Mon Jul 1 11:20:20 2024 rev:33 rq:1184029 version:2.19.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-google-api-core/python-google-api-core.changes 2024-05-17 20:06:10.501576885 +0200 +++ /work/SRC/openSUSE:Factory/.python-google-api-core.new.18349/python-google-api-core.changes 2024-07-01 11:20:54.280228422 +0200 @@ -1,0 +2,7 @@ +Sat Jun 29 19:31:29 UTC 2024 - Dirk Müller <dmuel...@suse.com> + +- update to 2.19.1: + * Add support for protobuf 5.x + * Ignore unknown fields in rest streaming. + +------------------------------------------------------------------- Old: ---- google-api-core-2.19.0.tar.gz New: ---- google-api-core-2.19.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-google-api-core.spec ++++++ --- /var/tmp/diff_new_pack.bpNaz0/_old 2024-07-01 11:20:54.748245472 +0200 +++ /var/tmp/diff_new_pack.bpNaz0/_new 2024-07-01 11:20:54.752245618 +0200 @@ -26,7 +26,7 @@ %endif %{?sle15_python_module_pythons} Name: python-google-api-core -Version: 2.19.0 +Version: 2.19.1 Release: 0 Summary: Google API client core library License: Apache-2.0 ++++++ google-api-core-2.19.0.tar.gz -> google-api-core-2.19.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/PKG-INFO new/google-api-core-2.19.1/PKG-INFO --- old/google-api-core-2.19.0/PKG-INFO 2024-04-30 19:02:12.001921400 +0200 +++ new/google-api-core-2.19.1/PKG-INFO 2024-06-24 18:51:14.210885800 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: google-api-core -Version: 2.19.0 +Version: 2.19.1 Summary: Google API client core library Home-page: https://github.com/googleapis/python-api-core Author: Google LLC @@ -23,7 +23,7 @@ Requires-Python: >=3.7 License-File: LICENSE Requires-Dist: googleapis-common-protos<2.0.dev0,>=1.56.2 -Requires-Dist: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0.dev0,>=3.19.5 +Requires-Dist: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0.dev0,>=3.19.5 Requires-Dist: proto-plus<2.0.0dev,>=1.22.3 Requires-Dist: google-auth<3.0.dev0,>=2.14.1 Requires-Dist: requests<3.0.0.dev0,>=2.18.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/google/api_core/grpc_helpers_async.py new/google-api-core-2.19.1/google/api_core/grpc_helpers_async.py --- old/google-api-core-2.19.0/google/api_core/grpc_helpers_async.py 2024-04-30 19:00:19.000000000 +0200 +++ new/google-api-core-2.19.1/google/api_core/grpc_helpers_async.py 2024-06-24 18:49:18.000000000 +0200 @@ -159,7 +159,6 @@ def _wrap_unary_errors(callable_): """Map errors for Unary-Unary async callables.""" - grpc_helpers._patch_callable_name(callable_) @functools.wraps(callable_) def error_remapped_callable(*args, **kwargs): @@ -169,23 +168,13 @@ return error_remapped_callable -def _wrap_stream_errors(callable_): +def _wrap_stream_errors(callable_, wrapper_type): """Map errors for streaming RPC async callables.""" - grpc_helpers._patch_callable_name(callable_) @functools.wraps(callable_) async def error_remapped_callable(*args, **kwargs): call = callable_(*args, **kwargs) - - if isinstance(call, aio.UnaryStreamCall): - call = _WrappedUnaryStreamCall().with_call(call) - elif isinstance(call, aio.StreamUnaryCall): - call = _WrappedStreamUnaryCall().with_call(call) - elif isinstance(call, aio.StreamStreamCall): - call = _WrappedStreamStreamCall().with_call(call) - else: - raise TypeError("Unexpected type of call %s" % type(call)) - + call = wrapper_type().with_call(call) await call.wait_for_connection() return call @@ -207,10 +196,16 @@ Returns: Callable: The wrapped gRPC callable. """ - if isinstance(callable_, aio.UnaryUnaryMultiCallable): - return _wrap_unary_errors(callable_) + grpc_helpers._patch_callable_name(callable_) + + if isinstance(callable_, aio.UnaryStreamMultiCallable): + return _wrap_stream_errors(callable_, _WrappedUnaryStreamCall) + elif isinstance(callable_, aio.StreamUnaryMultiCallable): + return _wrap_stream_errors(callable_, _WrappedStreamUnaryCall) + elif isinstance(callable_, aio.StreamStreamMultiCallable): + return _wrap_stream_errors(callable_, _WrappedStreamStreamCall) else: - return _wrap_stream_errors(callable_) + return _wrap_unary_errors(callable_) def create_channel( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/google/api_core/operations_v1/__init__.py new/google-api-core-2.19.1/google/api_core/operations_v1/__init__.py --- old/google-api-core-2.19.0/google/api_core/operations_v1/__init__.py 2024-04-30 19:00:19.000000000 +0200 +++ new/google-api-core-2.19.1/google/api_core/operations_v1/__init__.py 2024-06-24 18:49:18.000000000 +0200 @@ -14,7 +14,9 @@ """Package for interacting with the google.longrunning.operations meta-API.""" -from google.api_core.operations_v1.abstract_operations_client import AbstractOperationsClient +from google.api_core.operations_v1.abstract_operations_client import ( + AbstractOperationsClient, +) from google.api_core.operations_v1.operations_async_client import OperationsAsyncClient from google.api_core.operations_v1.operations_client import OperationsClient from google.api_core.operations_v1.transports.rest import OperationsRestTransport @@ -23,5 +25,5 @@ "AbstractOperationsClient", "OperationsAsyncClient", "OperationsClient", - "OperationsRestTransport" + "OperationsRestTransport", ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/google/api_core/operations_v1/transports/base.py new/google-api-core-2.19.1/google/api_core/operations_v1/transports/base.py --- old/google-api-core-2.19.0/google/api_core/operations_v1/transports/base.py 2024-04-30 19:00:19.000000000 +0200 +++ new/google-api-core-2.19.1/google/api_core/operations_v1/transports/base.py 2024-06-24 18:49:18.000000000 +0200 @@ -45,7 +45,7 @@ self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/google/api_core/operations_v1/transports/rest.py new/google-api-core-2.19.1/google/api_core/operations_v1/transports/rest.py --- old/google-api-core-2.19.0/google/api_core/operations_v1/transports/rest.py 2024-04-30 19:00:19.000000000 +0200 +++ new/google-api-core-2.19.1/google/api_core/operations_v1/transports/rest.py 2024-06-24 18:49:18.000000000 +0200 @@ -29,9 +29,13 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore from google.protobuf import json_format # type: ignore +import google.protobuf + import grpc from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO, OperationsTransport +PROTOBUF_VERSION = google.protobuf.__version__ + OptionalRetry = Union[retries.Retry, object] DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -66,7 +70,7 @@ self, *, host: str = "longrunning.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, @@ -184,11 +188,7 @@ "google.longrunning.Operations.ListOperations" ] - request_kwargs = json_format.MessageToDict( - request, - preserving_proto_field_name=True, - including_default_value_fields=True, - ) + request_kwargs = self._convert_protobuf_message_to_dict(request) transcoded_request = path_template.transcode(http_options, **request_kwargs) uri = transcoded_request["uri"] @@ -199,7 +199,6 @@ json_format.ParseDict(transcoded_request["query_params"], query_params_request) query_params = json_format.MessageToDict( query_params_request, - including_default_value_fields=False, preserving_proto_field_name=False, use_integers_for_enums=False, ) @@ -265,11 +264,7 @@ "google.longrunning.Operations.GetOperation" ] - request_kwargs = json_format.MessageToDict( - request, - preserving_proto_field_name=True, - including_default_value_fields=True, - ) + request_kwargs = self._convert_protobuf_message_to_dict(request) transcoded_request = path_template.transcode(http_options, **request_kwargs) uri = transcoded_request["uri"] @@ -280,7 +275,6 @@ json_format.ParseDict(transcoded_request["query_params"], query_params_request) query_params = json_format.MessageToDict( query_params_request, - including_default_value_fields=False, preserving_proto_field_name=False, use_integers_for_enums=False, ) @@ -339,11 +333,7 @@ "google.longrunning.Operations.DeleteOperation" ] - request_kwargs = json_format.MessageToDict( - request, - preserving_proto_field_name=True, - including_default_value_fields=True, - ) + request_kwargs = self._convert_protobuf_message_to_dict(request) transcoded_request = path_template.transcode(http_options, **request_kwargs) uri = transcoded_request["uri"] @@ -354,7 +344,6 @@ json_format.ParseDict(transcoded_request["query_params"], query_params_request) query_params = json_format.MessageToDict( query_params_request, - including_default_value_fields=False, preserving_proto_field_name=False, use_integers_for_enums=False, ) @@ -411,11 +400,7 @@ "google.longrunning.Operations.CancelOperation" ] - request_kwargs = json_format.MessageToDict( - request, - preserving_proto_field_name=True, - including_default_value_fields=True, - ) + request_kwargs = self._convert_protobuf_message_to_dict(request) transcoded_request = path_template.transcode(http_options, **request_kwargs) # Jsonify the request body @@ -423,7 +408,6 @@ json_format.ParseDict(transcoded_request["body"], body_request) body = json_format.MessageToDict( body_request, - including_default_value_fields=False, preserving_proto_field_name=False, use_integers_for_enums=False, ) @@ -435,7 +419,6 @@ json_format.ParseDict(transcoded_request["query_params"], query_params_request) query_params = json_format.MessageToDict( query_params_request, - including_default_value_fields=False, preserving_proto_field_name=False, use_integers_for_enums=False, ) @@ -458,6 +441,38 @@ return empty_pb2.Empty() + def _convert_protobuf_message_to_dict( + self, message: google.protobuf.message.Message + ): + r"""Converts protobuf message to a dictionary. + + When the dictionary is encoded to JSON, it conforms to proto3 JSON spec. + + Args: + message(google.protobuf.message.Message): The protocol buffers message + instance to serialize. + + Returns: + A dict representation of the protocol buffer message. + """ + # For backwards compatibility with protobuf 3.x 4.x + # Remove once support for protobuf 3.x and 4.x is dropped + # https://github.com/googleapis/python-api-core/issues/643 + if PROTOBUF_VERSION[0:2] in ["3.", "4."]: + result = json_format.MessageToDict( + message, + preserving_proto_field_name=True, + including_default_value_fields=True, # type: ignore # backward compatibility + ) + else: + result = json_format.MessageToDict( + message, + preserving_proto_field_name=True, + always_print_fields_with_no_presence=True, + ) + + return result + @property def list_operations( self, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/google/api_core/rest_streaming.py new/google-api-core-2.19.1/google/api_core/rest_streaming.py --- old/google-api-core-2.19.0/google/api_core/rest_streaming.py 2024-04-30 19:00:19.000000000 +0200 +++ new/google-api-core-2.19.1/google/api_core/rest_streaming.py 2024-06-24 18:49:18.000000000 +0200 @@ -118,7 +118,9 @@ def _grab(self): # Add extra quotes to make json.loads happy. if issubclass(self._response_message_cls, proto.Message): - return self._response_message_cls.from_json(self._ready_objs.popleft()) + return self._response_message_cls.from_json( + self._ready_objs.popleft(), ignore_unknown_fields=True + ) elif issubclass(self._response_message_cls, google.protobuf.message.Message): return Parse(self._ready_objs.popleft(), self._response_message_cls()) else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/google/api_core/version.py new/google-api-core-2.19.1/google/api_core/version.py --- old/google-api-core-2.19.0/google/api_core/version.py 2024-04-30 19:00:19.000000000 +0200 +++ new/google-api-core-2.19.1/google/api_core/version.py 2024-06-24 18:49:18.000000000 +0200 @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2.19.0" +__version__ = "2.19.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/google_api_core.egg-info/PKG-INFO new/google-api-core-2.19.1/google_api_core.egg-info/PKG-INFO --- old/google-api-core-2.19.0/google_api_core.egg-info/PKG-INFO 2024-04-30 19:02:11.000000000 +0200 +++ new/google-api-core-2.19.1/google_api_core.egg-info/PKG-INFO 2024-06-24 18:51:14.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: google-api-core -Version: 2.19.0 +Version: 2.19.1 Summary: Google API client core library Home-page: https://github.com/googleapis/python-api-core Author: Google LLC @@ -23,7 +23,7 @@ Requires-Python: >=3.7 License-File: LICENSE Requires-Dist: googleapis-common-protos<2.0.dev0,>=1.56.2 -Requires-Dist: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0.dev0,>=3.19.5 +Requires-Dist: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0.dev0,>=3.19.5 Requires-Dist: proto-plus<2.0.0dev,>=1.22.3 Requires-Dist: google-auth<3.0.dev0,>=2.14.1 Requires-Dist: requests<3.0.0.dev0,>=2.18.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/google_api_core.egg-info/requires.txt new/google-api-core-2.19.1/google_api_core.egg-info/requires.txt --- old/google-api-core-2.19.0/google_api_core.egg-info/requires.txt 2024-04-30 19:02:11.000000000 +0200 +++ new/google-api-core-2.19.1/google_api_core.egg-info/requires.txt 2024-06-24 18:51:14.000000000 +0200 @@ -1,5 +1,5 @@ googleapis-common-protos<2.0.dev0,>=1.56.2 -protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0.dev0,>=3.19.5 +protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0.dev0,>=3.19.5 proto-plus<2.0.0dev,>=1.22.3 google-auth<3.0.dev0,>=2.14.1 requests<3.0.0.dev0,>=2.18.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/setup.py new/google-api-core-2.19.1/setup.py --- old/google-api-core-2.19.0/setup.py 2024-04-30 19:00:19.000000000 +0200 +++ new/google-api-core-2.19.1/setup.py 2024-06-24 18:49:18.000000000 +0200 @@ -30,7 +30,7 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ "googleapis-common-protos >= 1.56.2, < 2.0.dev0", - "protobuf>=3.19.5,<5.0.0.dev0,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "protobuf>=3.19.5,<6.0.0.dev0,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", "proto-plus >= 1.22.3, <2.0.0dev", "google-auth >= 2.14.1, < 3.0.dev0", "requests >= 2.18.0, < 3.0.0.dev0", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/tests/asyncio/test_grpc_helpers_async.py new/google-api-core-2.19.1/tests/asyncio/test_grpc_helpers_async.py --- old/google-api-core-2.19.0/tests/asyncio/test_grpc_helpers_async.py 2024-04-30 19:00:19.000000000 +0200 +++ new/google-api-core-2.19.1/tests/asyncio/test_grpc_helpers_async.py 2024-06-24 18:49:18.000000000 +0200 @@ -98,11 +98,39 @@ @pytest.mark.asyncio +@pytest.mark.parametrize( + "callable_type,expected_wrapper_type", + [ + (grpc.aio.UnaryStreamMultiCallable, grpc_helpers_async._WrappedUnaryStreamCall), + (grpc.aio.StreamUnaryMultiCallable, grpc_helpers_async._WrappedStreamUnaryCall), + ( + grpc.aio.StreamStreamMultiCallable, + grpc_helpers_async._WrappedStreamStreamCall, + ), + ], +) +async def test_wrap_errors_w_stream_type(callable_type, expected_wrapper_type): + class ConcreteMulticallable(callable_type): + def __call__(self, *args, **kwargs): + raise NotImplementedError("Should not be called") + + with mock.patch.object( + grpc_helpers_async, "_wrap_stream_errors" + ) as wrap_stream_errors: + callable_ = ConcreteMulticallable() + grpc_helpers_async.wrap_errors(callable_) + assert wrap_stream_errors.call_count == 1 + wrap_stream_errors.assert_called_once_with(callable_, expected_wrapper_type) + + +@pytest.mark.asyncio async def test_wrap_stream_errors_unary_stream(): mock_call = mock.Mock(aio.UnaryStreamCall, autospec=True) multicallable = mock.Mock(return_value=mock_call) - wrapped_callable = grpc_helpers_async._wrap_stream_errors(multicallable) + wrapped_callable = grpc_helpers_async._wrap_stream_errors( + multicallable, grpc_helpers_async._WrappedUnaryStreamCall + ) await wrapped_callable(1, 2, three="four") multicallable.assert_called_once_with(1, 2, three="four") @@ -114,7 +142,9 @@ mock_call = mock.Mock(aio.StreamUnaryCall, autospec=True) multicallable = mock.Mock(return_value=mock_call) - wrapped_callable = grpc_helpers_async._wrap_stream_errors(multicallable) + wrapped_callable = grpc_helpers_async._wrap_stream_errors( + multicallable, grpc_helpers_async._WrappedStreamUnaryCall + ) await wrapped_callable(1, 2, three="four") multicallable.assert_called_once_with(1, 2, three="four") @@ -126,7 +156,9 @@ mock_call = mock.Mock(aio.StreamStreamCall, autospec=True) multicallable = mock.Mock(return_value=mock_call) - wrapped_callable = grpc_helpers_async._wrap_stream_errors(multicallable) + wrapped_callable = grpc_helpers_async._wrap_stream_errors( + multicallable, grpc_helpers_async._WrappedStreamStreamCall + ) await wrapped_callable(1, 2, three="four") multicallable.assert_called_once_with(1, 2, three="four") @@ -134,24 +166,15 @@ @pytest.mark.asyncio -async def test_wrap_stream_errors_type_error(): - mock_call = mock.Mock() - multicallable = mock.Mock(return_value=mock_call) - - wrapped_callable = grpc_helpers_async._wrap_stream_errors(multicallable) - - with pytest.raises(TypeError): - await wrapped_callable() - - -@pytest.mark.asyncio async def test_wrap_stream_errors_raised(): grpc_error = RpcErrorImpl(grpc.StatusCode.INVALID_ARGUMENT) mock_call = mock.Mock(aio.StreamStreamCall, autospec=True) mock_call.wait_for_connection = mock.AsyncMock(side_effect=[grpc_error]) multicallable = mock.Mock(return_value=mock_call) - wrapped_callable = grpc_helpers_async._wrap_stream_errors(multicallable) + wrapped_callable = grpc_helpers_async._wrap_stream_errors( + multicallable, grpc_helpers_async._WrappedStreamStreamCall + ) with pytest.raises(exceptions.InvalidArgument): await wrapped_callable() @@ -166,7 +189,9 @@ mock_call.read = mock.AsyncMock(side_effect=grpc_error) multicallable = mock.Mock(return_value=mock_call) - wrapped_callable = grpc_helpers_async._wrap_stream_errors(multicallable) + wrapped_callable = grpc_helpers_async._wrap_stream_errors( + multicallable, grpc_helpers_async._WrappedStreamStreamCall + ) wrapped_call = await wrapped_callable(1, 2, three="four") multicallable.assert_called_once_with(1, 2, three="four") @@ -189,7 +214,9 @@ mock_call.__aiter__ = mock.Mock(return_value=mocked_aiter) multicallable = mock.Mock(return_value=mock_call) - wrapped_callable = grpc_helpers_async._wrap_stream_errors(multicallable) + wrapped_callable = grpc_helpers_async._wrap_stream_errors( + multicallable, grpc_helpers_async._WrappedStreamStreamCall + ) wrapped_call = await wrapped_callable() with pytest.raises(exceptions.InvalidArgument) as exc_info: @@ -210,7 +237,9 @@ mock_call.__aiter__ = mock.Mock(return_value=mocked_aiter) multicallable = mock.Mock(return_value=mock_call) - wrapped_callable = grpc_helpers_async._wrap_stream_errors(multicallable) + wrapped_callable = grpc_helpers_async._wrap_stream_errors( + multicallable, grpc_helpers_async._WrappedStreamStreamCall + ) wrapped_call = await wrapped_callable() with pytest.raises(TypeError) as exc_info: @@ -224,7 +253,9 @@ mock_call = mock.Mock(aio.StreamStreamCall, autospec=True) multicallable = mock.Mock(return_value=mock_call) - wrapped_callable = grpc_helpers_async._wrap_stream_errors(multicallable) + wrapped_callable = grpc_helpers_async._wrap_stream_errors( + multicallable, grpc_helpers_async._WrappedStreamStreamCall + ) wrapped_call = await wrapped_callable() assert wrapped_call.__aiter__() == wrapped_call.__aiter__() @@ -239,7 +270,9 @@ mock_call.done_writing = mock.AsyncMock(side_effect=[None, grpc_error]) multicallable = mock.Mock(return_value=mock_call) - wrapped_callable = grpc_helpers_async._wrap_stream_errors(multicallable) + wrapped_callable = grpc_helpers_async._wrap_stream_errors( + multicallable, grpc_helpers_async._WrappedStreamStreamCall + ) wrapped_call = await wrapped_callable() @@ -295,7 +328,9 @@ result = grpc_helpers_async.wrap_errors(callable_) assert result == wrap_stream_errors.return_value - wrap_stream_errors.assert_called_once_with(callable_) + wrap_stream_errors.assert_called_once_with( + callable_, grpc_helpers_async._WrappedUnaryStreamCall + ) @pytest.mark.parametrize( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-2.19.0/tests/unit/test_rest_streaming.py new/google-api-core-2.19.1/tests/unit/test_rest_streaming.py --- old/google-api-core-2.19.0/tests/unit/test_rest_streaming.py 2024-04-30 19:00:19.000000000 +0200 +++ new/google-api-core-2.19.1/tests/unit/test_rest_streaming.py 2024-06-24 18:49:18.000000000 +0200 @@ -101,9 +101,11 @@ # json.dumps returns a string surrounded with quotes that need to be stripped # in order to be an actual JSON. json_responses = [ - self._response_message_cls.to_json(r).strip('"') - if issubclass(self._response_message_cls, proto.Message) - else MessageToJson(r).strip('"') + ( + self._response_message_cls.to_json(r).strip('"') + if issubclass(self._response_message_cls, proto.Message) + else MessageToJson(r).strip('"') + ) for r in responses ] logging.info(f"Sending JSON stream: {json_responses}")