We are using GAE python standard environment (Python 2.7) and suddenly our app started experiencing issues when serializing a datastore enum property. Our code has been deployed and working for over 6 months and today it is failing. For example:
class SomeType(messages.Enum):
FIRST_TYPE = 1
SECOND_TYPE = 2
THIRD_TYPE = 3
class SomeEntity(polymodel.PolyModel):
# Other fields not shown
something = msgprop.EnumProperty(SomeType, repeated=true)
def get_msg_data(self):
msg_data = {
'something': json.dumps(self.something)
}
return msg_data
The call to json.dumps above started failing in our instance today with an error like this:
TypeError: SomeType(FIRST_TYPE, 1) is not JSON serializable
Is anyone else seeing this? Note that using the same enum type within a message where we are not calling json.dumps directly works fine.