class_docstr: Manages SELECT and INSERT operations for Rocket Chat messages.
class_docstr_tok: ["Manages","SELECT","and","INSERT","operations","for","Rocket","Chat","messages","."]
docstr: Selects message data from the Rocket Chat API and returns it as a pandas DataFrame.
  
  Returns dataframe representing the Rocket Chat API results.
  
  Args:
      query (ast.Select): Given SQL SELECT query
docstr_tok: ["Selects","message","data","from","the","Rocket","Chat","API","and","returns","it","as","a","pandas","DataFrame",".","Returns","dataframe","representing","the","Rocket","Chat","API","results",".","Args",":","query","(","ast.Select",")",":","Given","SQL","SELECT","query"]
code: def select(self, query: ast.Select) -> pd.DataFrame:
      """Selects message data from the Rocket Chat API and returns it as a pandas DataFrame.
  
      Returns dataframe representing the Rocket Chat API results.
  
      Args:
          query (ast.Select): Given SQL SELECT query
      """
      filters = conditions_to_filter(query.where)
  
      if "room_id" not in filters:
          raise NotImplementedError()
  
      params = {}
  
      if query.limit:
          params["count"] = query.limit
  
      # See Channel Messages endpoint:
      # https://developer.rocket.chat/reference/api/rest-api/endpoints/core-endpoints/channels-endpoints/messages
      message_data = self.handler.call_api(
          "channels_history", filters["room_id"], **params
      )
  
      # Only return the columns we need to.
      message_rows = [
          message_to_dataframe_row(m) for m in message_data["messages"]
      ]
      df = pd.DataFrame(message_rows)
  
      df = sort_dataframe(df, query.order_by)
      df = project_dataframe(df, query.targets, self.get_columns())
  
      return df
  
imports: from typing import List
  import pandas
  from mindsdb.integrations.libs.api_handler import APITable
  from mindsdb.integrations.utilities.sql_utils import conditions_to_filter, project_dataframe, sort_dataframe
  from mindsdb_sql.parser import ast
label_desc: Use image node_id 1 for calling the ChannelMessagesTable obj's underlying member method code with example usage: obj.select(query) and returns: df