code: def gen_column_base_json_file(
      col_file,
      str_pk,
      data_fields,
      float_vect,
      rows,
      dim,
      start_uid=0,
      err_type="",
      **kwargs,
  ):
      if err_type == DataErrorType.str_on_int_pk:
          str_pk = True
  
      with open(col_file, "w") as f:
          f.write("{")
          f.write("\n")
          if rows > 0:
              # data columns
              for j in range(len(data_fields)):
                  data_field = data_fields[j]
                  if data_field == DataField.pk_field:
                      if str_pk:
                          f.write(
                              '"uid":["'
                              + ',"'.join(
                                  str(gen_unique_str()) + '"'
                                  for i in range(rows)
                              )
                              + "]"
                          )
                          f.write("\n")
                      else:
                          if err_type == DataErrorType.float_on_int_pk:
                              f.write(
                                  '"uid":['
                                  + ",".join(
                                      str(i + random.random())
                                      for i in range(
                                          start_uid, start_uid + rows
                                      )
                                  )
                                  + "]"
                              )
                          else:
                              f.write(
                                  '"uid":['
                                  + ",".join(
                                      str(i)
                                      for i in range(
                                          start_uid, start_uid + rows
                                      )
                                  )
                                  + "]"
                              )
                          f.write("\n")
                  if data_field == DataField.int_field:
                      if DataField.pk_field in data_fields:
                          # if not auto_id, use the same value as pk to check the query results later
                          f.write(
                              '"int_scalar":['
                              + ",".join(
                                  str(i)
                                  for i in range(
                                      start_uid, start_uid + rows
                                  )
                              )
                              + "]"
                          )
                      else:
                          f.write(
                              '"int_scalar":['
                              + ",".join(
                                  str(random.randint(-999999, 9999999))
                                  for i in range(rows)
                              )
                              + "]"
                          )
                      f.write("\n")
                  if data_field == DataField.float_field:
                      if err_type == DataErrorType.int_on_float_scalar:
                          f.write(
                              '"float_scalar":['
                              + ",".join(
                                  str(random.randint(-999999, 9999999))
                                  for i in range(rows)
                              )
                              + "]"
                          )
                      elif (
                          err_type == DataErrorType.str_on_float_scalar
                      ):
                          f.write(
                              '"float_scalar":["'
                              + ',"'.join(
                                  str(gen_unique_str()) + '"'
                                  for i in range(rows)
                              )
                              + "]"
                          )
                      else:
                          f.write(
                              '"float_scalar":['
                              + ",".join(
                                  str(random.random())
                                  for i in range(rows)
                              )
                              + "]"
                          )
                      f.write("\n")
                  if data_field == DataField.string_field:
                      f.write(
                          '"string_scalar":["'
                          + ',"'.join(
                              str(gen_unique_str()) + '"'
                              for i in range(rows)
                          )
                          + "]"
                      )
                      f.write("\n")
                  if data_field == DataField.bool_field:
                      if err_type == DataErrorType.typo_on_bool:
                          f.write(
                              '"bool_scalar":['
                              + ",".join(
                                  str(
                                      random.choice(
                                          [
                                              "True",
                                              "False",
                                              "TRUE",
                                              "FALSE",
                                              "1",
                                              "0",
                                          ]
                                      )
                                  )
                                  for i in range(rows)
                              )
                              + "]"
                          )
                      else:
                          f.write(
                              '"bool_scalar":['
                              + ",".join(
                                  str(random.choice(["true", "false"]))
                                  for i in range(rows)
                              )
                              + "]"
                          )
                      f.write("\n")
                  if data_field == DataField.vec_field:
                      # vector columns
                      if err_type == DataErrorType.one_entity_wrong_dim:
                          wrong_dim = (
                              dim + 8
                          )  # add 8 to compatible with binary vectors
                          wrong_row = kwargs.get("wrong_position", 0)
                          if wrong_row <= 0:
                              vectors1 = []
                          else:
                              vectors1 = (
                                  gen_float_vectors(wrong_row, dim)
                                  if float_vect
                                  else gen_binary_vectors(
                                      wrong_row, (dim // 8)
                                  )
                              )
                          if wrong_row >= rows - 1:
                              vectors2 = []
                          else:
                              vectors2 = (
                                  gen_float_vectors(
                                      rows - wrong_row - 1, dim
                                  )
                                  if float_vect
                                  else gen_binary_vectors(
                                      rows - wrong_row - 1, (dim // 8)
                                  )
                              )
                          vectors_wrong_dim = (
                              gen_float_vectors(1, wrong_dim)
                              if float_vect
                              else gen_binary_vectors(
                                  1, (wrong_dim // 8)
                              )
                          )
                          vectors = (
                              vectors1 + vectors_wrong_dim + vectors2
                          )
                      elif (
                          err_type == DataErrorType.str_on_vector_field
                      ):
                          wrong_row = kwargs.get("wrong_position", 0)
                          if wrong_row <= 0:
                              vectors1 = []
                          else:
                              vectors1 = (
                                  gen_float_vectors(wrong_row, dim)
                                  if float_vect
                                  else gen_binary_vectors(
                                      wrong_row, (dim // 8)
                                  )
                              )
                          if wrong_row >= rows - 1:
                              vectors2 = []
                          else:
                              vectors2 = (
                                  gen_float_vectors(
                                      rows - wrong_row - 1, dim
                                  )
                                  if float_vect
                                  else gen_binary_vectors(
                                      rows - wrong_row - 1, (dim // 8)
                                  )
                              )
                          invalid_str_vectors = (
                              gen_str_invalid_vectors(1, dim)
                              if float_vect
                              else gen_str_invalid_vectors(
                                  1, (dim // 8)
                              )
                          )
                          vectors = (
                              vectors1 + invalid_str_vectors + vectors2
                          )
                      else:
                          vectors = (
                              gen_float_vectors(rows, dim)
                              if float_vect
                              else gen_binary_vectors(rows, (dim // 8))
                          )
                      f.write(
                          '"vectors":['
                          + ",".join(
                              str(x).replace("'", '"') for x in vectors
                          )
                          + "]"
                      )
                      f.write("\n")
                  if j != len(data_fields) - 1:
                      f.write(",")
          f.write("}")
          f.write("\n")
  
imports: import copy
  import json
  import os
  import time
  import numpy
  import pandas
  import random
  from faker import Faker
  from sklearn import preprocessing
  from common.common_func import gen_unique_str
  from common.minio_comm import copy_files_to_minio
  from utils.util_log import test_log
label_desc: Use image node_id 7 for calling a global function with example usage: gen_column_base_json_file(col_file, str_pk, data_fields, float_vect, rows, dim, start_uid, err_type) without return types