class_docstr: This handler handles connection and execution of the Weaviate statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Weaviate","statements","."]
docstr: Insert data into the Weaviate database.
docstr_tok: ["Insert","data","into","the","Weaviate","database","."]
code: def insert(
      self,
      table_name: str,
      data: pd.DataFrame,
      columns: List[str] = None,
  ) -> HandlerResponse:
      """
      Insert data into the Weaviate database.
      """
  
      table_name = table_name.capitalize()
  
      # drop columns with all None values
  
      data.dropna(axis=1, inplace=True)
  
      data = data.to_dict(orient="records")
      # parsing the records one by one as we need to update metadata (which has variable columns)
      for record in data:
          metadata_data = record.get(TableField.METADATA.value)
          data_object = {
              "content": record.get(TableField.CONTENT.value)
          }
          data_obj_id = (
              record[TableField.ID.value]
              if TableField.ID.value in record.keys()
              else generate_uuid5(data_object)
          )
          obj_id = self._client.data_object.create(
              data_object=data_object,
              class_name=table_name,
              vector=record[TableField.EMBEDDINGS.value],
              uuid=data_obj_id,
          )
          if metadata_data:
              meta_id = self.add_metadata(metadata_data, table_name)
              self._client.data_object.reference.add(
                  from_uuid=obj_id,
                  from_property_name="associatedMetadata",
                  to_uuid=meta_id,
              )
      return Response(resp_type=RESPONSE_TYPE.OK)
  
imports: from collections import OrderedDict
  from datetime import datetime
  from typing import List, Optional
  import weaviate
  from weaviate.embedded import EmbeddedOptions
  import pandas
  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
  from weaviate.util import generate_uuid5
label_desc: Use image node_id 11 for calling the WeaviateDBHandler obj's underlying member method code with example usage: obj.insert(table_name, data, columns) and returns: Response