class_docstr: This handler handles connection and execution of the Xata statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Xata","statements","."]
docstr: Create a table with the given name in the Xata database.
docstr_tok: ["Create","a","table","with","the","given","name","in","the","Xata","database","."]
code: def create_table(
      self, table_name: str, if_not_exists=True
  ) -> HandlerResponse:
      """Create a table with the given name in the Xata database."""
      try:
          resp = self._client.table().create(table_name)
          if not resp.is_success():
              raise Exception(
                  f"Unable to create table {table_name}: {resp['message']}"
              )
          resp = self._client.table().set_schema(
              table_name=table_name,
              payload={
                  "columns": [
                      {
                          "name": "embeddings",
                          "type": "vector",
                          "vector": {
                              "dimension": self._create_table_params[
                                  "dimension"
                              ]
                          },
                      },
                      {"name": "content", "type": "text"},
                      {"name": "metadata", "type": "json"},
                  ]
              },
          )
          if not resp.is_success():
              raise Exception(
                  f"Unable to change schema of table {table_name}: {resp['message']}"
              )
      except Exception as e:
          return Response(
              resp_type=RESPONSE_TYPE.ERROR,
              error_message=f"{e}",
          )
      return Response(resp_type=RESPONSE_TYPE.OK)
  
imports: from collections import OrderedDict
  from typing import List, Optional
  import pandas
  import json
  import xata
  from xata.helpers import BulkProcessor
  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 6 for calling the XataHandler obj's underlying member method code with example usage: obj.create_table(table_name, if_not_exists) and returns: Response, Response