code: def test_search_keys_autodetection(requests_mock: Mocker):
      url = "http://fake_url2"
  
      mock_default_requests(requests_mock, url)
  
      search_task_id = "123"
      validation_search_task_id = mock_validation_search(
          requests_mock, url, search_task_id
      )
      mock_initial_progress(requests_mock, url, search_task_id)
      mock_validation_progress(
          requests_mock, url, validation_search_task_id
      )
      ads_search_task_id = mock_initial_and_validation_summary(
          requests_mock,
          url,
          search_task_id,
          validation_search_task_id,
      )
      mock_get_metadata(requests_mock, url, search_task_id)
      mock_get_task_metadata_v2(
          requests_mock,
          url,
          ads_search_task_id,
          ProviderTaskMetadataV2(
              features=[
                  FeaturesMetadataV2(
                      name="feature",
                      type="numeric",
                      source="ads",
                      hit_rate=99.0,
                      shap_value=10.1,
                  )
              ],
              hit_rate_metrics=HitRateMetrics(
                  etalon_row_count=10000,
                  max_hit_count=9990,
                  hit_rate=0.999,
                  hit_rate_percent=99.9,
              ),
              eval_set_metrics=[
                  ModelEvalSet(
                      eval_set_index=1,
                      hit_rate=1.0,
                      hit_rate_metrics=HitRateMetrics(
                          etalon_row_count=1000,
                          max_hit_count=1000,
                          hit_rate=1.0,
                          hit_rate_percent=100.0,
                      ),
                  ),
                  ModelEvalSet(
                      eval_set_index=2,
                      hit_rate=0.99,
                      hit_rate_metrics=HitRateMetrics(
                          etalon_row_count=1000,
                          max_hit_count=990,
                          hit_rate=0.99,
                          hit_rate_percent=99.0,
                      ),
                  ),
              ],
          ),
      )
      path_to_mock_features = os.path.join(
          os.path.dirname(os.path.realpath(__file__)),
          "test_data/binary/mock_features.parquet",
      )
      mock_raw_features(
          requests_mock, url, search_task_id, path_to_mock_features
      )
  
      enricher = FeaturesEnricher(
          search_keys={"date": SearchKey.DATE},
          endpoint=url,
          api_key="fake_api_key",
          logs_enabled=False,
      )
  
      df = pd.DataFrame(
          {
              # "country": ["EC", "GB", "US"],
              "postal_code": ["103305", "504938", "293049"],
              "phone": ["9992223311", "28376283746", "283764736"],
              "eml": [
                  "test@mail.ru",
                  "test2@gmail.com",
                  "test3@yahoo.com",
              ],
              "date": ["2021-01-01", "2022-01-01", "2023-01-01"],
              "target": [0, 1, 0],
          }
      )
      original_search = Dataset.search
      original_min_count = Dataset.MIN_ROWS_COUNT
  
      def mock_search(
          self,
          *args,
          **kwargs,
      ):
          self.validate()
          columns = set(self.columns.to_list())
          assert columns == {
              "system_record_id",
              "postal_code_13534a",
              "phone_45569d",
              "date_0e8763",
              "target",
              "hashed_email_64ff8c",
              "email_one_domain_3b0a68",
              "email_domain_10c73f",
          }
          assert {
              "postal_code_13534a",
              "phone_45569d",
              "hashed_email_64ff8c",
              "email_one_domain_3b0a68",
              "date_0e8763",
          } == {sk for sublist in self.search_keys for sk in sublist}
          search_task = SearchTask(
              search_task_id, self, endpoint=url, api_key="fake_api_key"
          )
          search_task.provider_metadata_v2 = [
              ProviderTaskMetadataV2(
                  features=[
                      FeaturesMetadataV2(
                          name="feature",
                          type="numeric",
                          source="ads",
                          hit_rate=100,
                          shap_value=0.5,
                      )
                  ]
              )
          ]
          return search_task
  
      Dataset.search = mock_search
      Dataset.MIN_ROWS_COUNT = 1
  
      try:
          enricher.fit(df.drop(columns="target"), df.target)
      except AssertionError:
          raise
      except Exception as e:
          assert e.args[0].path == "/public/api/v2/search/123/progress"
      finally:
          Dataset.search = original_search
          Dataset.MIN_ROWS_COUNT = original_min_count
  
      df["country"] = "GB"
      # enricher.search_id = search_task_id
  
      old_validation = Dataset.validation
  
      def mock_validation(
          self,
          *args,
          **kwargs,
      ):
          self.validate(validate_target=False)
          assert {
              # "country_aff64e",
              "postal_code_13534a",
              "phone_45569d",
              "hashed_email_64ff8c",
              "email_one_domain_3b0a68",
              "date_0e8763",
          } == {sk for sublist in self.search_keys for sk in sublist}
          raise TestException()
  
      Dataset.validation = mock_validation
  
      try:
          enricher.transform(df.drop(columns="target"))
          raise AssertionError("Should fail")
      except TestException:
          pass
      finally:
          Dataset.validation = old_validation
  
imports: import os
  from datetime import date
  from typing import List, Optional
  import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from requests_mock.mocker import Mocker
  from upgini import FeaturesEnricher, SearchKey
  from upgini.dataset import Dataset
  from upgini.errors import ValidationError
  from upgini.http import _RestClient
  from upgini.metadata import CVType, FeaturesMetadataV2, HitRateMetrics, ModelEvalSet, ModelTaskType, ProviderTaskMetadataV2, RuntimeParameters
  from upgini.resource_bundle import bundle
  from upgini.search_task import SearchTask
  from upgini.utils.datetime_utils import DateTimeSearchKeyConverter
  from .utils import mock_default_requests, mock_get_metadata, mock_get_task_metadata_v2, mock_initial_and_validation_summary, mock_initial_progress, mock_initial_search, mock_initial_summary, mock_raw_features, mock_validation_progress, mock_validation_raw_features, mock_validation_search, mock_validation_summary
label_desc: Use image node_id 28 for calling a global function with example usage: test_search_keys_autodetection(requests_mock) and returns: search_task