docstr: Retrieves the data from the channel using SlackAPI
  
  Args:
      channel_name
  
  Returns:
      conversation_history
code: def select(self, query: ast.Select) -> Response:
      """
      Retrieves the data from the channel using SlackAPI
  
      Args:
          channel_name
  
      Returns:
          conversation_history
      """
  
      # override the default function
      def parse_utc_date(date_str):
          date_obj = datetime.fromisoformat(date_str).replace(
              tzinfo=timezone.utc
          )
          return date_obj.strftime("%Y-%m-%d %H:%M:%S")
  
      # Get the channels list and ids
      channels = self.client.conversations_list(
          types="public_channel,private_channel"
      )["channels"]
      channel_ids = {c["name"]: c["id"] for c in channels}
  
      # Extract comparison conditions from the query
      conditions = extract_comparison_conditions(query.where)
      channel_name = conditions[0][2]
      filters = []
      params = {}
      order_by_conditions = {}
  
      # Build the filters and parameters for the query
      for op, arg1, arg2 in conditions:
          if arg1 == "channel":
              if arg2 in channel_ids:
                  params["channel"] = channel_ids[arg2]
              else:
                  raise ValueError(f"Channel '{arg2}' not found")
  
          elif arg1 == "limit":
              if op == "=":
                  params["limit"] = int(arg2)
              else:
                  raise NotImplementedError(f"Unknown op: {op}")
  
          elif arg1 == "created_at":
              date = parse_utc_date(arg2)
              if op == ">":
                  params["start_time"] = date
              elif op == "<":
                  params["end_time"] = date
              else:
                  raise NotImplementedError
  
          else:
              filters.append([op, arg1, arg2])
  
      if query.limit:
          params["limit"] = int(query.limit.value)
  
      if query.order_by and len(query.order_by) > 0:
          order_by_conditions["columns"] = []
          order_by_conditions["ascending"] = []
  
          for an_order in query.order_by:
              if an_order.field.parts[1] == "messages":
                  order_by_conditions["columns"].append("messages")
  
                  if an_order.direction == "ASC":
                      order_by_conditions["ascending"].append(True)
                  else:
                      order_by_conditions["ascending"].append(False)
              else:
                  raise ValueError(
                      f"Order by unknown column {an_order.field.parts[1]}"
                  )
  
      # Retrieve the conversation history
      try:
          result = self.client.conversations_history(
              channel=params["channel"]
          )
      except SlackApiError as e:
          logger.error("Error creating conversation: {}".format(e))
          raise e
  
      # Get columns for the query and convert SlackResponse object to pandas DataFrame
      columns = []
      for target in query.targets:
          if isinstance(target, ast.Star):
              columns = [
                  "channel",
                  "client_msg_id",
                  "type",
                  "subtype",
                  "ts",
                  "created_at",
                  "user",
                  "text",
                  "attachments",
                  "files",
                  "reactions",
                  "thread_ts",
                  "reply_count",
                  "reply_users_count",
                  "latest_reply",
                  "reply_users",
              ]
              break
          elif isinstance(target, ast.Identifier):
              columns.append(target.parts[-1])
              logger.warning(target)
          else:
              raise NotImplementedError
  
      # columns to lower case
      columns = [name.lower() for name in columns]
  
      # convert SlackResponse object to pandas DataFrame
      result = pd.DataFrame(result["messages"])
  
      # Remove null rows from the result
      result = result[result["text"].notnull()]
  
      # add absent columns
      for col in set(columns) & set(result.columns) ^ set(columns):
          result[col] = None
  
      # Add the selected channel to the dataframe
      result["channel"] = channel_name
  
      # translate the time stamp into a 'created_at' field
      result["ts_datetime"] = pd.to_datetime(
          result["ts"].astype(float), unit="s"
      )
      result["created_at"] = result["ts_datetime"].dt.strftime(
          "%Y-%m-%d %H:%M:%S"
      )
  
      # if we have 'created_at' attribute, then execute this
      if "start_time" in params:
          result = result[
              result["ts_datetime"]
              > datetime.strptime(
                  params["start_time"], "%Y-%m-%d %H:%M:%S"
              )
          ]
      elif "end_time" in params:
          result = result[
              result["ts_datetime"]
              < datetime.strptime(
                  params["end_time"], "%Y-%m-%d %H:%M:%S"
              )
          ]
  
      # filter by columns to be returned
      result = result[columns]
  
      # Sort the data based on order_by_conditions
      if len(order_by_conditions.get("columns", [])) > 0:
          result = result.sort_values(
              by=order_by_conditions["columns"],
              ascending=order_by_conditions["ascending"],
          )
  
      # Limit the result based on the query limit
      if query.limit:
          result = result.head(query.limit.value)
  
      # Alias the target column based on the query
      for target in query.targets:
          if target.alias:
              result.rename(
                  columns={target.parts[-1]: str(target.alias)},
                  inplace=True,
              )
  
      # ensure the data in the table is of string type
      return result.astype(str)
  
imports: import os
  from datetime import datetime, timezone
  import ast
  from typing import List
  import pandas
  from slack_sdk import WebClient
  from slack_sdk.errors import SlackApiError
  from slack_sdk.web.slack_response import SlackResponse
  from slack_sdk.socket_mode import SocketModeClient
  from slack_sdk.socket_mode.request import SocketModeRequest
  from slack_sdk.socket_mode.response import SocketModeResponse
  from mindsdb.interfaces.chatbot.types import ChatBotMessage
  from mindsdb.utilities import log
  from mindsdb.utilities.config import Config
  from mindsdb_sql.parser import ast
  from mindsdb_sql.parser.ast import ASTNode, Update, Delete
  from mindsdb_sql.planner.utils import query_traversal
  from mindsdb.integrations.libs.api_handler import APIChatHandler, APITable, FuncParser
  from mindsdb.integrations.utilities.sql_utils import extract_comparison_conditions
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
label_desc: Use image node_id 2 for calling the SlackChannelsTable obj's underlying member method code with example usage: obj.select(query) and returns: result, date_obj