def METHOD_NAME(self, query: str) -> Response:
    """
    Receive SQL query and runs it
    :param query: The SQL query to run in TDEngine
    :return: returns the records from the current recordset
    """
    need_to_close = self.is_connected is False
    connection = self.connect()
    cur = connection.cursor() 
    try:
            cur.execute(query)
            if cur.rowcount != 0:
                result = cur.fetchall()
                response = Response(
                    RESPONSE_TYPE.TABLE,
                    pd.DataFrame(
                        result,
                        columns=[x[0] for x in cur.description]
                    )
                )
            else:
                response = Response(RESPONSE_TYPE.OK)
            connection.commit()
    except Exception as e:
            log.error(f'Error running query: {query} on {self.connection_data["database"]}!')
            response = Response(
                RESPONSE_TYPE.ERROR,
                error_message=str(e)
            )
            # connection.rollback()
    cur.close()
    if need_to_close is True:
        self.disconnect()
    return response