class_docstr: The Emails Table implementation
class_docstr_tok: ["The","Emails","Table","implementation"]
docstr: Pulls email data from the connected account.
  
  Parameters
  ----------
  query : ast.Select
     Given SQL SELECT query
  
  Returns
  -------
  pd.DataFrame
      Emails matching the query
  
  Raises
  ------
  ValueError
      If the query contains an unsupported condition
docstr_tok: ["Pulls","email","data","from","the","connected","account",".","Parameters","--","--","--","--","--","query",":","ast.Select","Given","SQL","SELECT","query","Returns","--","--","--","-","pd.DataFrame","Emails","matching","the","query","Raises","--","--","--","ValueError","If","the","query","contains","an","unsupported","condition"]
code: def select(self, query: ast.Select) -> pd.DataFrame:
      """Pulls email data from the connected account.
  
      Parameters
      ----------
      query : ast.Select
         Given SQL SELECT query
  
      Returns
      -------
      pd.DataFrame
          Emails matching the query
  
      Raises
      ------
      ValueError
          If the query contains an unsupported condition
      """
  
      select_statement_parser = SELECTQueryParser(
          query, "emails", self.get_columns()
      )
      (
          selected_columns,
          where_conditions,
          order_by_conditions,
          result_limit,
      ) = select_statement_parser.parse_query()
  
      search_params = {}
      for op, arg1, arg2 in where_conditions:
          if arg1 == "created_at":
              date = self.parse_date(arg2)
              if op == ">":
                  search_params["since_date"] = date
              elif op == "<":
                  search_params["until_date"] = date
              else:
                  raise NotImplementedError(
                      "Only > and < operators are supported for created_at column."
                  )
              continue
  
          elif arg1 in [
              "mailbox",
              "subject",
              "to",
              "from",
              "since_emailid",
          ]:
              if op != "=":
                  raise NotImplementedError(
                      "Only = operator is supported for mailbox, subject, to and from columns."
                  )
              else:
                  if arg1 == "from":
                      search_params["from_"] = arg2
                  else:
                      search_params[arg1] = arg2
  
          else:
              raise NotImplementedError(f"Unsupported column: {arg1}.")
  
      connection = self.handler.connect()
      emails_df = connection.search_email(**search_params)
  
      select_statement_executor = SELECTQueryExecutor(
          emails_df,
          selected_columns,
          [],
          order_by_conditions,
          result_limit,
      )
      emails_df = select_statement_executor.execute_query()
  
      return emails_df
  
file_path: mindsdb/mindsdb/integrations/handlers/email_handler/email_tables.py
imports: import datetime
  import ast
  import pytz
  import pandas
  from mindsdb_sql.parser import ast
  from mindsdb.integrations.libs.api_handler import APITable
  from mindsdb.integrations.handlers.utilities.query_utilities import SELECTQueryParser, SELECTQueryExecutor
  from mindsdb.integrations.handlers.utilities.query_utilities.insert_query_utilities import INSERTQueryParser
label_desc: Use image node_id 1 for calling the EmailsTable obj's underlying member method code with example usage: obj.select(query) and returns: emails_df