class_docstr: This handler handles connection and execution of the Pinecone statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Pinecone","statements","."]
docstr: Insert data into pinecone index passed in through `table_name` parameter.
docstr_tok: ["Insert","data","into","pinecone","index","passed","in","through","`","table_name","`","parameter","."]
code: def insert(
      self,
      table_name: str,
      data: pd.DataFrame,
      columns: List[str] = None,
  ) -> HandlerResponse:
      """Insert data into pinecone index passed in through `table_name` parameter."""
      upsert_batch_size = 99  # API reccomendation
      index = self._get_index_handle(table_name)
      if index is None:
          return Response(
              resp_type=RESPONSE_TYPE.ERROR,
              error_message=f"Error getting index '{table_name}', are you sure the name is correct?",
          )
      data.rename(
          columns={
              TableField.ID.value: "id",
              TableField.EMBEDDINGS.value: "values",
              TableField.METADATA.value: "metadata",
          },
          inplace=True,
      )
      data = data[["id", "values", "metadata"]]
      try:
          for chunk in (
              data[pos : pos + upsert_batch_size]
              for pos in range(0, len(data), upsert_batch_size)
          ):
              chunk = chunk.to_dict(orient="records")
              index.upsert(vectors=chunk)
      except Exception as e:
          return Response(
              resp_type=RESPONSE_TYPE.ERROR,
              error_message=f"Error upserting data into {table_name}: {e}",
          )
      return Response(resp_type=RESPONSE_TYPE.OK)
  
imports: from collections import OrderedDict
  from typing import List, Optional
  import pinecone
  import pandas
  import ast
  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 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 12 for calling the PineconeHandler obj's underlying member method code with example usage: obj.insert(table_name, data, columns) and returns: Response, Response, Response