class_docstr: This class extracts a number of basic text descriptives from FeedbackDataset
  records using the TextDescriptives library and adds them as record metadata.
class_docstr_tok: ["This","class","extracts","a","number","of","basic","text","descriptives","from","FeedbackDataset","records","using","the","TextDescriptives","library","and","adds","them","as","record","metadata","."]
code: def _create_metadata_property_settings(
      self,
      dataset: Union[FeedbackDataset, RemoteFeedbackDataset],
      fields: List[str],
      overwrite: bool = False,
  ) -> Union[FeedbackDataset, RemoteFeedbackDataset]:
      # Create a mock record with the specified fields
      records = [
          FeedbackRecord(
              fields={field: "mock the mocker" for field in fields}
          )
      ]
      # Extract text descriptives metrics from records
      extracted_metrics = self._extract_metrics_for_all_fields(
          records=records, fields=fields, overwrite=overwrite
      )
      # Cast integer and boolean columns to Python native types
      extracted_metrics = self._cast_to_python_types(extracted_metrics)
      # Clean column names
      extracted_metrics.columns = [
          self._clean_column_name(col)
          for col in extracted_metrics.columns
      ]
      # Create metadata properties based on dataframe columns and data types
      metadata_properties = self._create_metadata_properties(
          extracted_metrics
      )
      # Add each metadata property iteratively to the dataset
      available_metadata_properties = [
          prop.name for prop in dataset.metadata_properties
      ]
      for prop in metadata_properties:
          if prop.name in available_metadata_properties:
              # potentially overwrite visible_for_annotators settings
              metadata_property = dataset.metadata_property_by_name(
                  prop.name
              )
              if (
                  overwrite
                  and metadata_property.visible_for_annotators
                  != prop.visible_for_annotators
              ):
                  dataset.delete_metadata_property(prop.name)
                  dataset.add_metadata_property(prop)
          else:
              dataset.add_metadata_property(prop)
      return dataset
  
imports: import logging
  import re
  import warnings
  from typing import Any, List, Optional, Union
  import numpy
  import pandas
  from rich.progress import Progress
  from argilla.client.feedback.dataset.local.dataset import FeedbackDataset
  from argilla.client.feedback.dataset.remote.dataset import RemoteFeedbackDataset
  from argilla.client.feedback.schemas.metadata import FloatMetadataProperty, IntegerMetadataProperty, TermsMetadataProperty
  from argilla.client.feedback.schemas.records import FeedbackRecord
  from argilla.client.feedback.schemas.remote.records import RemoteFeedbackRecord
  from argilla.utils.dependency import require_dependencies
label_desc: Use image node_id 7 for calling the TextDescriptivesExtractor obj's underlying member method code with example usage: obj._create_metadata_property_settings(dataset, fields, overwrite) and returns: dataset