class_docstr: Handles connection and execution of the Qdrant statements.
class_docstr_tok: ["Handles","connection","and","execution","of","the","Qdrant","statements","."]
docstr: Handler for the insert query
  
  Args:
      table_name (str): The name of the table to be inserted into
      data (pd.DataFrame): The data to be inserted
      columns (List[str], optional): Columns to be inserted into. Unused as the values are derived from the "data" argument. Defaults to None.
  
  Returns:
      HandlerResponse: The common query handler response
docstr_tok: ["Handler","for","the","insert","query","Args",":","table_name","(","str",")",":","The","name","of","the","table","to","be","inserted","into","data","(","pd.DataFrame",")",":","The","data","to","be","inserted","columns","(","List","[","str","]",",","optional",")",":","Columns","to","be","inserted","into",".","Unused","as","the","values","are","derived","from","the","``","data","''","argument",".","Defaults","to","None",".","Returns",":","HandlerResponse",":","The","common","query","handler","response"]
code: def insert(
      self,
      table_name: str,
      data: pd.DataFrame,
      columns: List[str] = None,
  ) -> HandlerResponse:
      """Handler for the insert query
  
      Args:
          table_name (str): The name of the table to be inserted into
          data (pd.DataFrame): The data to be inserted
          columns (List[str], optional): Columns to be inserted into. Unused as the values are derived from the "data" argument. Defaults to None.
  
      Returns:
          HandlerResponse: The common query handler response
      """
      assert len(data[TableField.ID.value]) == len(
          data[TableField.EMBEDDINGS.value]
      ), "Number of ids and embeddings must be equal"
  
      # Qdrant doesn't have a distinction between documents and metadata
      # Any data that is to be stored should be placed in the "payload" field
      data = data.to_dict(orient="list")
      payloads = []
      content_list = data[TableField.CONTENT.value]
      metadata_list = data[TableField.METADATA.value]
  
      for document, metadata in zip_longest(
          content_list, metadata_list, fillvalue=None
      ):
          payload = {}
  
          # Insert the document with a "document" key in the payload
          if document is not None:
              payload["document"] = document
  
          # Unpack all the metadata fields into the payload
          if metadata is not None:
              payload = {**payload, **metadata}
  
          if payload:
              payloads.append(payload)
  
      # IDs can be either integers or strings(UUIDs)
      # The following step ensures proper type of numberic values
      ids = [
          int(id) if str(id).isdigit() else id
          for id in data[TableField.ID.value]
      ]
      self._client.upsert(
          table_name,
          points=models.Batch(
              ids=ids,
              vectors=data[TableField.EMBEDDINGS.value],
              payloads=payloads,
          ),
      )
  
      return Response(resp_type=RESPONSE_TYPE.OK)
  
imports: from collections import OrderedDict
  from typing import Any, List, Optional
  from itertools import zip_longest
  from qdrant_client import QdrantClient, models
  import pandas
  from mindsdb.integrations.libs.response import HandlerResponse
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from mindsdb.integrations.libs.response import RESPONSE_TYPE
  from mindsdb.integrations.libs.response import HandlerResponse
  from mindsdb.integrations.libs.response import HandlerStatusResponse
  from mindsdb.integrations.libs.vectordatabase_handler import FilterCondition, FilterOperator, TableField, VectorStoreHandler
  from mindsdb.utilities import log
label_desc: Use image node_id 8 for calling the QdrantHandler obj's underlying member method code with example usage: obj.insert(table_name, data, columns) and returns: Response