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: Update data in the weaviate database.
docstr_tok: ["Update","data","in","the","weaviate","database","."]
code: def update(
      self,
      table_name: str,
      data: pd.DataFrame,
      columns: List[str] = None,
  ) -> HandlerResponse:
      """
      Update data in the weaviate database.
      """
      table_name = table_name.capitalize()
      metadata_table_name = table_name.capitalize() + "_metadata"
      data_list = data.to_dict("records")
      for row in data_list:
          non_metadata_keys = [
              key
              for key in row.keys()
              if key and not key.startswith(TableField.METADATA.value)
          ]
          metadata_keys = [
              key.split(".")[1]
              for key in row.keys()
              if key and key.startswith(TableField.METADATA.value)
          ]
  
          id_filter = {
              "path": ["id"],
              "operator": "Equal",
              "valueText": row["id"],
          }
          metadata_id_query = f"associatedMetadata {{ ... on {metadata_table_name} {{ _additional {{ id }} }} }}"
          result = (
              self._client.query.get(table_name, metadata_id_query)
              .with_additional(["id"])
              .with_where(id_filter)
              .do()
          )
  
          metadata_id = result["data"]["Get"][table_name][0][
              "associatedMetadata"
          ][0]["_additional"]["id"][0]
          # updating table
          self._client.data_object.update(
              uuid=row["id"],
              class_name=table_name,
              data_object={key: row[key] for key in non_metadata_keys},
          )
          # updating metadata
          self._client.data_object.update(
              uuid=metadata_id,
              class_name=metadata_table_name,
              data_object={key: row[key] for key in metadata_keys},
          )
      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 12 for calling the WeaviateDBHandler obj's underlying member method code with example usage: obj.update(table_name, data, columns) and returns: Response