class_docstr: This handler handles connection and execution of the Apache Phoenix statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Apache","Phoenix","statements","."]
docstr: Check connection to the handler.
  Returns:
      HandlerStatusResponse
docstr_tok: ["Check","connection","to","the","handler",".","Returns",":","HandlerStatusResponse"]
code: def check_connection(self) -> StatusResponse:
      """
      Check connection to the handler.
      Returns:
          HandlerStatusResponse
      """
  
      response = StatusResponse(False)
      need_to_close = self.is_connected is False
  
      try:
          self.connect()
          response.success = True
      except Exception as e:
          logger.error(
              f"Error connecting to the Phoenix Query Server, {e}!"
          )
          response.error_message = str(e)
      finally:
          if response.success is True and need_to_close:
              self.disconnect()
          if response.success is False and self.is_connected is True:
              self.is_connected = False
  
      return response
  
imports: from typing import Optional
  from collections import OrderedDict
  import pandas
  import phoenixdb
  import requests
  from requests.exceptions import InvalidSchema
  import json
  from mindsdb_sql import parse_sql
  from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender
  from mindsdb.integrations.libs.base import DatabaseHandler
  from pyphoenix.sqlalchemy_phoenix import PhoenixDialect
  from mindsdb_sql.parser.ast.base import ASTNode
  from mindsdb.utilities import log
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
label_desc: Use image node_id 5 for calling the PhoenixHandler obj's underlying member method code with example usage: obj.check_connection() and returns: response