@classmethod
  def _GetFieldValue(cls, field):
    if not field:
      return None
    value_type = field.value().type()

    if value_type in search_util.TEXT_DOCUMENT_FIELD_TYPES:
      return field.value().string_value()
    if value_type == document_pb.FieldValue.DATE:
      value = field.value().string_value()
      return search_util.DeserializeDate(value)
    if value_type == document_pb.FieldValue.NUMBER:
      value = field.value().string_value()
      return float(value)
    if value_type == document_pb.FieldValue.GEO:
      value = field.value().geo()
      return geo_util.LatLng(value.lat(), value.lng())
    raise TypeError('No conversion defined for type %s' % value_type)
Returns the value of a field as the correct type.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/api/search/stub/expression_evaluator.py/ExpressionEvaluator._GetFieldValue