code: def test_update_records_metrics_extracted(
      records, td_extractor: TextDescriptivesExtractor
  ) -> None:
      extracted_metrics = pd.DataFrame({"text_n_tokens": [4, 5]})
      td_extractor._extract_metrics_for_all_fields = MagicMock(
          return_value=extracted_metrics
      )
      td_extractor._cast_to_python_types = MagicMock(
          return_value=extracted_metrics
      )
      td_extractor._clean_column_name = MagicMock(
          side_effect=lambda col: col
      )
      td_extractor._add_text_descriptives_to_metadata = MagicMock(
          return_value=records
      )
      updated_records = td_extractor.update_records(records)
      td_extractor._extract_metrics_for_all_fields.assert_called_once()
      td_extractor._cast_to_python_types.assert_called_once_with(
          extracted_metrics
      )
      td_extractor._clean_column_name.assert_called_with(
          "text_n_tokens"
      )
      td_extractor._add_text_descriptives_to_metadata.assert_called_once_with(
          records, extracted_metrics
      )
      assert updated_records == records
  
imports: from unittest.mock import MagicMock
  import pandas
  import pytest
  from argilla.client.feedback.dataset import FeedbackDataset
  from argilla.client.feedback.integrations.textdescriptives import TextDescriptivesExtractor
  from argilla.client.feedback.schemas.fields import TextField
  from argilla.client.feedback.schemas.metadata import FloatMetadataProperty, IntegerMetadataProperty, TermsMetadataProperty
  from argilla.client.feedback.schemas.questions import TextQuestion
  from argilla.client.feedback.schemas.records import FeedbackRecord
label_desc: Use image node_id 9 for calling a global function with example usage: test_update_records_metrics_extracted(records, td_extractor) without return types