class_docstr: Base class for handlers associated to the applications APIs (e.g. twitter, slack, discord  etc.)
class_docstr_tok: ["Base","class","for","handlers","associated","to","the","applications","APIs","(","e.g",".","twitter",",","slack",",","discord","etc",".",")"]
code: def query(self, query: ASTNode):
      if isinstance(query, Select):
          result = self._get_table(query.from_table).select(query)
      elif isinstance(query, Update):
          result = self._get_table(query.table).update(query)
      elif isinstance(query, Insert):
          result = self._get_table(query.table).insert(query)
      elif isinstance(query, Delete):
          result = self._get_table(query.table).delete(query)
      else:
          raise NotImplementedError
  
      if result is None:
          return Response(RESPONSE_TYPE.OK)
      elif isinstance(result, pd.DataFrame):
          return Response(RESPONSE_TYPE.TABLE, result)
      else:
          raise NotImplementedError
  
imports: from typing import Any
  import ast
  import pandas
  from mindsdb_sql.parser.ast import ASTNode, Select, Insert, Update, Delete
  from mindsdb_sql.parser.ast.select.identifier import Identifier
  from mindsdb.integrations.libs.base import BaseHandler
  from mindsdb.integrations.libs.api_handler_exceptions import TableAlreadyExists, TableNotFound
  from mindsdb.integrations.libs.response import HandlerResponse, RESPONSE_TYPE
label_desc: Use image node_id 4 for calling the APIHandler obj's underlying member method code with example usage: obj.query(query) and returns: Response, Response