class_docstr: Datasets records DAO
class_docstr_tok: ["Datasets","records","DAO"]
code: def compute_metric(
      self,
      dataset: DatasetDB,
      metric_id: str,
      metric_params: Dict[str, Any] = None,
      query: Optional[BaseRecordsQuery] = None,
  ):
      return self._es.compute_metric(
          id=dataset.id,
          metric_id=metric_id,
          query=query,
          params=metric_params,
      )
  
file_path: argilla/src/argilla/server/daos/records.py
imports: import datetime
  from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Type
  from fastapi import Depends
  from argilla.server.daos.backend import GenericElasticEngineBackend
  from argilla.server.daos.backend.base import ClosedIndexError, IndexNotFoundError
  from argilla.server.daos.backend.generic_elastic import PaginatedSortInfo
  from argilla.server.daos.backend.search.model import BaseRecordsQuery, SortableField
  from argilla.server.daos.models.datasets import DatasetDB
  from argilla.server.daos.models.records import DaoRecordsSearch, DaoRecordsSearchResults, RecordDB
  from argilla.server.errors import ClosedDatasetError, MissingDatasetRecordsError
label_desc: Use image node_id 5 for calling the DatasetRecordsDAO obj's underlying member method code with example usage: obj.compute_metric(dataset, metric_id, metric_params, query) and returns: self