docstr: triggered at the SELECT query
  
  Args:
      query (ast.Select): user's entered query
  
  Returns:
      pd.DataFrame: the queried information
docstr_tok: ["triggered","at","the","SELECT","query","Args",":","query","(","ast.Select",")",":","user","'s","entered","query","Returns",":","pd.DataFrame",":","the","queried","information"]
code: def select(self, query: ast.Select) -> pd.DataFrame:
      """triggered at the SELECT query
  
      Args:
          query (ast.Select): user's entered query
  
      Returns:
          pd.DataFrame: the queried information
      """
      _id = None
      selected_columns = []
  
      # Get id from where clause, if available
      conditions = extract_comparison_conditions(query.where)
      for op, arg1, arg2 in conditions:
          if arg1 == "id" and op == "=":
              _id = arg2
          else:
              raise ValueError("Unsupported condition in WHERE clause")
  
      # Get selected columns from query
      for target in query.targets:
          if isinstance(target, ast.Star):
              selected_columns = self.get_columns()
              break
          elif isinstance(target, ast.Identifier):
              selected_columns.append(target.parts[-1])
          else:
              raise ValueError(f"Unknown query target {type(target)}")
  
      # Initialize the result DataFrame
      result_df = None
  
      if _id is not None:
          # Fetch data using the provided endpoint for the specific id
          df = self.handler.call_intercom_api(
              endpoint=f"/articles/{_id}"
          )
  
          if len(df) > 0:
              result_df = df[selected_columns]
      else:
          # Fetch data without specifying an id
          page_size = (
              100  # The page size you want to use for API requests
          )
          limit = query.limit.value if query.limit else None
          result_df = pd.DataFrame(columns=selected_columns)
  
          if limit:
              # Calculate the number of pages required
              page_count = (limit + page_size - 1) // page_size
          else:
              page_count = 1
  
          for page in range(1, page_count + 1):
              if limit == 0:
                  break
              if limit:
                  # Calculate the page size for this request
                  current_page_size = min(page_size, limit)
              else:
                  current_page_size = page_size
  
              df = pd.DataFrame(
                  self.handler.call_intercom_api(
                      endpoint="/articles",
                      params={
                          "page": page,
                          "per_page": current_page_size,
                      },
                  )["data"][0]
              )
              if len(df) == 0:
                  break
              result_df = pd.concat(
                  [result_df, df[selected_columns]], ignore_index=True
              )
              if limit:
                  limit -= current_page_size
      return result_df
  
file_path: mindsdb/mindsdb/integrations/handlers/intercom_handler/intercom_tables.py
imports: from typing import List
  from mindsdb.integrations.utilities.sql_utils import extract_comparison_conditions
  from mindsdb.integrations.libs.api_handler import APIHandler, APITable
  from mindsdb_sql.parser import ast
  import pandas
  from mindsdb_sql.parser.ast.select.constant import Constant
  import json
label_desc: Use image node_id 2 for calling the Articles obj's underlying member method code with example usage: obj.select(query) and returns: result_df