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: Delete a class from the weaviate database.
docstr_tok: ["Delete","a","class","from","the","weaviate","database","."]
code: def drop_table(
      self, table_name: str, if_exists=True
  ) -> HandlerResponse:
      """
      Delete a class from the weaviate database.
      """
      table_name = table_name.capitalize()
      metadata_table_name = table_name.capitalize() + "_metadata"
      table_id_query = (
          self._client.query.get(table_name)
          .with_additional(["id"])
          .do()
      )
      table_ids = [
          i["_additional"]["id"]
          for i in table_id_query["data"]["Get"][table_name]
      ]
      metadata_table_id_query = (
          self._client.query.get(metadata_table_name)
          .with_additional(["id"])
          .do()
      )
      metadata_ids = [
          i["_additional"]["id"]
          for i in metadata_table_id_query["data"]["Get"][
              metadata_table_name
          ]
      ]
      self._client.batch.delete_objects(
          class_name=table_name,
          where={
              "path": ["id"],
              "operator": "ContainsAny",
              "valueTextArray": table_ids,
          },
      )
      self._client.batch.delete_objects(
          class_name=metadata_table_name,
          where={
              "path": ["id"],
              "operator": "ContainsAny",
              "valueTextArray": metadata_ids,
          },
      )
      try:
          self._client.schema.delete_class(table_name)
          self._client.schema.delete_class(metadata_table_name)
      except ValueError:
          if if_exists:
              return Response(resp_type=RESPONSE_TYPE.OK)
          else:
              return Response(
                  resp_type=RESPONSE_TYPE.ERROR,
                  error_message=f"Table {table_name} does not exist!",
              )
  
      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 15 for calling the WeaviateDBHandler obj's underlying member method code with example usage: obj.drop_table(table_name, if_exists) and returns: Response, Response, Response