code: def test_diff_target_dups(requests_mock: Mocker):
      url = "http://fake_url2"
  
      mock_default_requests(requests_mock, url)
  
      enricher = FeaturesEnricher(
          search_keys={"date": SearchKey.DATE},
          endpoint=url,
          api_key="fake_api_key",
          logs_enabled=False,
      )
  
      df = pd.DataFrame(
          {
              "date": [
                  "2021-01-01",
                  "2021-01-01",
                  "2023-01-01",
                  "2023-01-01",
              ],
              "feature": [11, 11, 12, 13],
              "target": [0, 1, 0, 1],
          }
      )
      original_search = Dataset.search
      original_min_rows = Dataset.MIN_ROWS_COUNT
  
      def mock_search(
          self,
          *args,
          **kwargs,
      ):
          self.validate()
          assert len(self.data) == 2
          print(self.data)
          assert self.data.loc[0, "date_0e8763"] == 1672531200000
          assert self.data.loc[0, "feature_2ad562"] == 12
          assert self.data.loc[0, "target"] == 0
          assert self.data.loc[1, "date_0e8763"] == 1672531200000
          assert self.data.loc[1, "feature_2ad562"] == 13
          assert self.data.loc[1, "target"] == 1
          return SearchTask(
              "123", self, endpoint=url, api_key="fake_api_key"
          )
  
      Dataset.search = mock_search
      Dataset.MIN_ROWS_COUNT = 1
  
      try:
          enricher.fit(df.drop(columns="target"), df.target)
          raise AssertionError("Search should fail")
      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_rows
  
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 30 for calling a global function with example usage: test_diff_target_dups(requests_mock) and returns: SearchTask