rename_fields#

geodesic.boson.rename_fields(case=None, field_map={}, input_collection=None, output_collection=None)[source]#

Rename fields in the properties of a search response.

Parameters:
  • case (str, optional) – case to apply to the field names. Defaults to None. One of [“upper”, “lower”]

  • field_map (dict, optional) – mapping of old field names to new field names. Defaults to {}.

  • input_collection (str, optional) – name of the input collection to apply transform to. Defaults to None (all collections)

  • output_collection (str, optional) – name of the virtual collection that the transform will be applied to. Defaults to None (no virtual collection created)

Examples

>>> # Rename the field "old_field" to "new_field"
>>> transform = rename_fields(field_map={"old_field": "new_field"})
>>> # Rename the field "old_field" to "new_field" and make it uppercase
>>> transform = rename_fields(case="upper", field_map={"old_field": "new_field"})