code: def test_logging_with_metadata_limits_exceeded(argilla_user: "User"):
      dataset = "test_logging_with_metadata_limits_exceeded"
  
      init(
          api_key=argilla_user.api_key, workspace=argilla_user.username
      )
  
      delete_ignoring_errors(dataset)
  
      expected_record = TextClassificationRecord(
          text="The input text",
          metadata={
              k: f"this is a string {k}"
              for k in range(0, settings.metadata_fields_limit + 1)
          },
      )
      with pytest.raises(BadRequestApiError):
          log(expected_record, name=dataset)
  
      expected_record.metadata = {
          k: f"This is a string {k}"
          for k in range(0, settings.metadata_fields_limit)
      }
      # Dataset creation with data
      log(expected_record, name=dataset)
      # This call will check already included fields
      log(expected_record, name=dataset)
  
      expected_record.metadata["new_key"] = "value"
      with pytest.raises(BadRequestApiError):
          log(expected_record, name=dataset)
  
imports: from typing import TYPE_CHECKING
  import argilla
  import pytest
  from argilla.client.api import load, log
  from argilla.client.client import Argilla
  from argilla.client.datasets import read_datasets
  from argilla.client.models import TextClassificationRecord, TokenClassificationRecord
  from argilla.client.sdk.commons.errors import BadRequestApiError, GenericApiError, ValidationApiError
  from argilla.client.singleton import init
  from argilla.server.settings import settings
  from tests.factories import WorkspaceFactory
  from tests.integration.utils import delete_ignoring_errors
label_desc: Use image node_id 8 for calling a global function with example usage: test_logging_with_metadata_limits_exceeded(argilla_user) without return types