code: def to_json(self):
      try:
          data = None
          if self.data_frame is not None:
              data = self.data_frame.to_json(
                  orient="split", index=False, date_format="iso"
              )
      except Exception as e:
          logger.error(
              "%s.to_json: error - %s", self.__class__.__name__, e
          )
          data = None
      return {
          "type": self.resp_type,
          "query": self.query,
          "data_frame": data,
          "error_code": self.error_code,
          "error": self.error_message,
      }
  
file_path: mindsdb/mindsdb/integrations/libs/response.py
imports: from pandas import DataFrame
  from mindsdb.utilities import log
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from mindsdb_sql.parser.ast import ASTNode
label_desc: Use image node_id 3 for calling the HandlerResponse obj's underlying member method code with example usage: obj.to_json() and returns: dict