You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 25, 2026. It is now read-only.
google.protobuf.Value field in request message breaks corresponding generated flattened method test #414
Yields the following error in the test_my_flattened_method generated unit test:
assert args[0].parameter == struct.Value(null_value=struct.NullValue.NULL_VALUE)
E AssertionError: assert None == null_value: NULL_VALUE\n
E + where None = parameters {\n null_value: NULL_VALUE\n}\n.parameters
E + and null_value: NULL_VALUE\n = <class 'google.protobuf.struct_pb2.Value'>(null_value=0)
E + where <class 'google.protobuf.struct_pb2.Value'> = struct.Value
E + and 0 = <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f85c7f3059
0>.NULL_VALUE
E + where <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f85c7f30590>
= struct.NullValue
____________________________ test_predict_flattened ____________________________
def test_predict_flattened():
client = PredictionServiceClient(credentials=ga_credentials.AnonymousCredentials(),)
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.predict), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = prediction_service.PredictResponse()
# Call the method with a truthy value for each flattened field,
# using the keyword arguments to the method.
client.predict(
endpoint="endpoint_value",
instances=[struct_pb2.Value(null_value=struct_pb2.NullValue.NULL_VALUE)],
parameters=struct_pb2.Value(null_value=struct_pb2.NullValue.NULL_VALUE),
)
# Establish that the underlying call was made with the expected
# request object values.
assert len(call.mock_calls) == 1
_, args, _ = call.mock_calls[0]
assert args[0].endpoint == "endpoint_value"
assert args[0].instances == [
struct_pb2.Value(null_value=struct_pb2.NullValue.NULL_VALUE)
]
> assert args[0].parameters == struct_pb2.Value(
null_value=struct_pb2.NullValue.NULL_VALUE
)
E assert None == null_value: NULL_VALUE\n
E + where None = endpoint: "endpoint_value"\ninstances {\n null_value: NULL_VALUE\n}\nparameters {\n null_value: NULL_VALUE\n}\n.parameters
E + and null_value: NULL_VALUE\n = <class 'google.protobuf.struct_pb2.Value'>(null_value=0)
E + where <class 'google.protobuf.struct_pb2.Value'> = struct_pb2.Value
E + and 0 = <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f4fc6d44278>.NULL_VALUE
E + where <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f4fc6d44278> = struct_pb2.NullValue
Activity
arithmetic1728 commentedon Oct 13, 2020
any updates as we are out of slo
hkdevandla commentedon Dec 29, 2020
Any updates on this?
parthea commentedon Jul 2, 2021
Hi @software-dov ,
I'm hitting this issue in googleapis/python-aiplatform#498 . See build log.
parthea commentedon Jul 10, 2021
Bumping back to p2 as I've re-added the workaround that was previously present.