class_docstr: The Microsoft Teams Channel Messages Table implementation.       
class_docstr_tok: ["The","Microsoft","Teams","Channel","Messages","Table","implementation","."]
docstr: Pulls data from the "GET /teams/{group_id}/channels/{channel_id}/messages" and "GET /teams/{group_id}/channels/{channel_id}/messages/{message_id}" Microsoft Graph API endpoints.
  
  Parameters
  ----------
  query: ast.Select
      Given SQL SELECT query.
  
  Returns
  -------
  pd.DataFrame
      Microsoft Teams Channel Messages matching the query.
  
  Raises
  ------
  ValueError
      If the query contains an unsupported target (column).
  
  NotImplementedError
      If the query contains an unsupported condition.
docstr_tok: ["Pulls","data","from","the","``","GET","\/teams\/","{","group_id","}","\/channels\/","{","channel_id","}","\/messages","''","and","``","GET","\/teams\/","{","group_id","}","\/channels\/","{","channel_id","}","\/messages\/","{","message_id","}","''","Microsoft","Graph","API","endpoints",".","Parameters","--","--","--","--","--","query",":","ast.Select","Given","SQL","SELECT","query",".","Returns","--","--","--","-","pd.DataFrame","Microsoft","Teams","Channel","Messages","matching","the","query",".","Raises","--","--","--","ValueError","If","the","query","contains","an","unsupported","target","(","column",")",".","NotImplementedError","If","the","query","contains","an","unsupported","condition","."]
code: def select(self, query: ast.Select) -> pd.DataFrame:
      """
      Pulls data from the "GET /teams/{group_id}/channels/{channel_id}/messages" and "GET /teams/{group_id}/channels/{channel_id}/messages/{message_id}" Microsoft Graph API endpoints.
  
      Parameters
      ----------
      query: ast.Select
          Given SQL SELECT query.
  
      Returns
      -------
      pd.DataFrame
          Microsoft Teams Channel Messages matching the query.
  
      Raises
      ------
      ValueError
          If the query contains an unsupported target (column).
  
      NotImplementedError
          If the query contains an unsupported condition.
      """
  
      select_statement_parser = SELECTQueryParser(
          query, "channel_messages", self.get_columns()
      )
  
      (
          selected_columns,
          where_conditions,
          order_by_conditions,
          result_limit,
      ) = select_statement_parser.parse_query()
  
      # only the = operator is supported for the id, channelIdentity_teamId and channelIdentity_channelId columns
      team_id, channel_id, message_id = None, None, None
      for op, arg1, arg2 in where_conditions:
          if arg1 == "id":
              if op == "=":
                  message_id = arg2
              else:
                  raise NotImplementedError(
                      "Only '=' operator is supported for id column."
                  )
  
          if arg1 == "channelIdentity_teamId":
              if op == "=":
                  team_id = arg2
              else:
                  raise NotImplementedError(
                      "Only '=' operator is supported for id column."
                  )
  
          if arg1 == "channelIdentity_channelId":
              if op == "=":
                  channel_id = arg2
              else:
                  raise NotImplementedError(
                      "Only '=' operator is supported for teamId column."
                  )
  
      messages_df = pd.json_normalize(
          self.get_messages(team_id, channel_id, message_id), sep="_"
      )
  
      # if all parameters are given, remove the id, channelIdentity_teamId and channelIdentity_channelId columns from the where conditions as they have already been evaluated in the API call (get_messages)
      if team_id and channel_id and message_id:
          where_conditions = [
              where_condition
              for where_condition in where_conditions
              if where_condition[1]
              not in [
                  "id",
                  "channelIdentity_teamId",
                  "channelIdentity_channelId",
              ]
          ]
  
      select_statement_executor = SELECTQueryExecutor(
          messages_df,
          selected_columns,
          where_conditions,
          order_by_conditions,
          result_limit if query.limit else None,
      )
  
      messages_df = select_statement_executor.execute_query()
  
      return messages_df
  
imports: import pandas
  from typing import Text, List, Dict, Any
  from mindsdb.utilities import log
  from mindsdb_sql.parser import ast
  from mindsdb.integrations.libs.api_handler import APITable
  from mindsdb.integrations.handlers.ms_teams_handler.settings import ms_teams_handler_config
  from mindsdb.integrations.handlers.utilities.query_utilities.insert_query_utilities import INSERTQueryParser
  from mindsdb.integrations.handlers.utilities.query_utilities.select_query_utilities import SELECTQueryParser, SELECTQueryExecutor
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: messages_df