Get historical metrics: protocol message object error
anthonyrka opened this issue · 1 comments
anthonyrka commented
Returns the following error:
AttributeError: Assignment not allowed to message, map, or repeated field "keywords" in protocol message object.
The correct way to set repeated fields in Protocol Buffers is to use the .append() method for singular values and .extend() for multiple values.
This:
request.keywords = ["mars cruise", "cheap cruise", "jupiter cruise"]
should be:
request.keywords.extend(["mars cruise", "cheap cruise", "jupiter cruise"])
```
BenRKarl commented
@anthonyrka I'm assuming you have the configuration parameter use_proto_plus
set to False
, is that the case? Note that the examples are all written with this flag set to True
, so they will likely not function properly when set to false. See this guide for details on the interface differences between proto-plus and regular protobuf messages.