docstr: Selects data from the API and returns it as a pandas DataFrame
  
  Returns dataframe representing the API results.
  
  Args:
      query (ast.Select): SQL SELECT query
docstr_tok: ["Selects","data","from","the","API","and","returns","it","as","a","pandas","DataFrame","Returns","dataframe","representing","the","API","results",".","Args",":","query","(","ast.Select",")",":","SQL","SELECT","query"]
code: def select(self, query: ast.Select) -> pd.DataFrame:
      """Selects data from the API and returns it as a pandas DataFrame
  
      Returns dataframe representing the API results.
  
      Args:
          query (ast.Select): SQL SELECT query
  
      """
      conditions = extract_comparison_conditions(query.where)
      params = {}
  
      for op, arg1, arg2 in conditions:
          if op != "=":
              raise NotImplementedError(f"Unsupported Operator: {op}")
          elif arg1 == "query":
              params["q"] = arg2
          else:
              raise NotImplementedError(f"Unknown clause: {arg1}")
  
      if query.order_by:
          if len(query.order_by) > 1:
              raise ValueError(
                  "Unsupported to order by multiple fields"
              )
          order_item = query.order_by[0]
          sort_column = ".".join(order_item.field.parts[1:])
          # make sure that column is sortable
          if sort_column not in type(self).SORTABLE_COLUMNS:
              raise ValueError(f"Order by unknown column {sort_column}")
          params.update(
              {
                  "sort": sort_column,
                  "order": order_item.direction.lower(),
              }
          )
  
      if query.limit is not None:
          params["size"] = query.limit.value
      result = self.handler.call_webz_api(
          method_name=type(self).TABLE_NAME, params=params
      )
  
      # filter targets
      columns = []
      for target in query.targets:
          if isinstance(target, ast.Star):
              columns = self.get_columns()
              break
          elif isinstance(target, ast.Identifier):
              columns.append(target.parts[-1])
          else:
              raise NotImplementedError(
                  f"Unknown query target {type(target)}"
              )
  
      # columns to lower case
      columns = [name.lower() for name in columns]
  
      if len(result) == 0:
          return pd.DataFrame([], columns=columns)
  
      # add absent columns
      for col in set(columns) & set(result.columns) ^ set(columns):
          result[col] = None
  
      # filter by columns
      result = result[columns]
  
      # Rename columns
      for target in query.targets:
          if target.alias:
              result.rename(
                  columns={target.parts[-1]: str(target.alias)},
                  inplace=True,
              )
      return result
  
file_path: mindsdb/mindsdb/integrations/handlers/webz_handler/webz_tables.py
imports: from typing import List
  import pandas
  from mindsdb_sql.parser import ast
  from mindsdb.integrations.libs.api_handler import APITable
  from mindsdb.integrations.utilities.sql_utils import extract_comparison_conditions
label_desc: Use image node_id 1 for calling the WebzBaseAPITable obj's underlying member method code with example usage: obj.select(query) and returns: result, pd