docstr: Method：
  1. create a collection with partition key on
  2. verify insert, build, load and search successfully
  3. drop collection
docstr_tok: ["Method\uff1a","1.","create","a","collection","with","partition","key","on","2.","verify","insert",",","build",",","load","and","search","successfully","3.","drop","collection"]
code: def test_partition_key_on_field_schema(self, par_key_field):
      """
      Method：
      1. create a collection with partition key on
      2. verify insert, build, load and search successfully
      3. drop collection
      """
      self._connect()
      pk_field = cf.gen_int64_field(name="pk", is_primary=True)
      int64_field = cf.gen_int64_field(
          is_partition_key=(
              par_key_field == ct.default_int64_field_name
          )
      )
      string_field = cf.gen_string_field(
          is_partition_key=(
              par_key_field == ct.default_string_field_name
          )
      )
      vector_field = cf.gen_float_vec_field()
      schema = cf.gen_collection_schema(
          fields=[pk_field, int64_field, string_field, vector_field],
          auto_id=True,
      )
      c_name = cf.gen_unique_str("par_key")
      collection_w, _ = self.collection_wrap.init_collection(
          name=c_name, schema=schema
      )
      assert len(collection_w.partitions) == ct.default_partition_num
  
      # insert
      nb = 1000
      string_prefix = cf.gen_str_by_length(length=6)
      entities_per_parkey = 10
      for _ in range(entities_per_parkey):
          int64_values = [i for i in range(0, nb)]
          string_values = [string_prefix + str(i) for i in range(0, nb)]
          float_vec_values = gen_vectors(nb, ct.default_dim)
          data = [int64_values, string_values, float_vec_values]
          collection_w.insert(data)
  
      # flush
      collection_w.flush()
      # build index
      collection_w.create_index(
          field_name=vector_field.name, index_params=ct.default_index
      )
      # load
      collection_w.load()
      # search
      nq = 10
      search_vectors = gen_vectors(nq, ct.default_dim)
      # search with mixed filtered
      res1 = collection_w.search(
          data=search_vectors,
          anns_field=vector_field.name,
          param=ct.default_search_params,
          limit=entities_per_parkey,
          expr=f'{int64_field.name} in [1,3,5] && {string_field.name} in ["{string_prefix}1","{string_prefix}3","{string_prefix}5"]',
          output_fields=[int64_field.name, string_field.name],
          check_task=CheckTasks.check_search_results,
          check_items={"nq": nq, "limit": ct.default_limit},
      )[0]
      # search with partition key filter only or with non partition key
      res2 = collection_w.search(
          data=search_vectors,
          anns_field=vector_field.name,
          param=ct.default_search_params,
          limit=entities_per_parkey,
          expr=f"{int64_field.name} in [1,3,5]",
          output_fields=[int64_field.name, string_field.name],
          check_task=CheckTasks.check_search_results,
          check_items={"nq": nq, "limit": ct.default_limit},
      )[0]
      # search with partition key filter only or with non partition key
      res3 = collection_w.search(
          data=search_vectors,
          anns_field=vector_field.name,
          param=ct.default_search_params,
          limit=entities_per_parkey,
          expr=f'{string_field.name} in ["{string_prefix}1","{string_prefix}3","{string_prefix}5"]',
          output_fields=[int64_field.name, string_field.name],
          check_task=CheckTasks.check_search_results,
          check_items={"nq": nq, "limit": ct.default_limit},
      )[0]
      # assert the results persist
      assert res1.ids == res2.ids == res3.ids
  
imports: import pytest
  from base.client_base import TestcaseBase
  from common import common_func
  from common import common_type
  from common.common_type import CaseLabel, CheckTasks
  from utils.util_pymilvus import *
label_desc: Use image node_id 1 for calling the TestPartitionKeyParams obj's underlying member method code with example usage: obj.test_partition_key_on_field_schema(par_key_field) without return types