code: def map_2_es_sort_configuration(
      self, schema: Dict[str, Any], sort: SortConfig
  ) -> Optional[List[Dict[str, Any]]]:
      if not sort.sort_by or sort.shuffle:
          return None
  
      # TODO(@frascuchon): compute valid list from the schema
      valid_fields = sort.valid_fields or [
          "id",
          "metadata",
          "score",
          "predicted",
          "predicted_as",
          "predicted_by",
          "annotated_as",
          "annotated_by",
          "status",
          "last_updated",
          "event_timestamp",
      ]
  
      id_field = "id"
      id_keyword_field = "id.keyword"
      schema = schema or {}
      mappings = self._clean_mappings(schema.get("mappings", {}))
      use_id_keyword = "text" == mappings.get("id")
  
      es_sort = []
      for sortable_field in sort.sort_by or [SortableField(id="id")]:
          if valid_fields:
              if sortable_field.id.split(".")[0] not in valid_fields:
                  raise AssertionError(
                      f"Wrong sort id {sortable_field.id}. Valid values are: {[str(v) for v in valid_fields]}"
                  )
          field = sortable_field.id
          if field == id_field and use_id_keyword:
              field = id_keyword_field
          es_sort.append({field: {"order": sortable_field.order}})
  
      return es_sort
  
imports: import logging
  import re
  from enum import Enum
  from typing import Any, Dict, List, Optional, Union
  from argilla.server.daos.backend.query_helpers import filters
  from argilla.server.daos.backend.search.model import BackendDatasetsQuery, BackendQuery, BackendRecordsQuery, BaseDatasetsQuery, QueryRange, SortableField, SortConfig
label_desc: Use image node_id 5 for calling the EsQueryBuilder obj's underlying member method code with example usage: obj.map_2_es_sort_configuration(schema, sort) and returns: es_sort, None