class_docstr: This handler handles connection and execution of the LanceDB statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","LanceDB","statements","."]
docstr: Create a collection with the given name in the LanceDB database.
docstr_tok: ["Create","a","collection","with","the","given","name","in","the","LanceDB","database","."]
code: def create_table(
      self, table_name: str, if_not_exists=True
  ) -> HandlerResponse:
      """
      Create a collection with the given name in the LanceDB database.
      """
      try:
          data = {
              TableField.ID.value: str,
              TableField.CONTENT.value: str,
              TableField.METADATA.value: object,
              TableField.EMBEDDINGS.value: object,
          }
          df = pd.DataFrame(columns=data.keys()).astype(data)
          self._client.create_table(table_name, df)
      except Exception as e:
          return Response(
              resp_type=RESPONSE_TYPE.ERROR,
              error_message=f"Unable to create collection `{table_name}`: {e}",
          )
      return Response(resp_type=RESPONSE_TYPE.OK)
  
imports: from collections import OrderedDict
  from typing import List, Optional
  import lancedb
  import pandas
  import pyarrow
  from lance.vector import vec_to_table
  import duckdb
  import json
  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 13 for calling the LanceDBHandler obj's underlying member method code with example usage: obj.create_table(table_name, if_not_exists) and returns: Response, Response