class_docstr: A class representing the balance table.
  
  This class inherits from APITable and provides functionality to select data
  from the balance endpoint of the Plaid API and return it as a pandas DataFrame.
  
  Methods:
      select(ast.Select): Select data from the balance table and return it as a pandas DataFrame.
      get_columns(): Get the list of column names for the balance table.
class_docstr_tok: ["A","class","representing","the","balance","table",".","This","class","inherits","from","APITable","and","provides","functionality","to","select","data","from","the","balance","endpoint","of","the","Plaid","API","and","return","it","as","a","pandas","DataFrame",".","Methods",":","select","(","ast.Select",")",":","Select","data","from","the","balance","table","and","return","it","as","a","pandas","DataFrame",".","get_columns","(",")",":","Get","the","list","of","column","names","for","the","balance","table","."]
code: def filter_columns(
      self, result: pd.DataFrame, query: ast.Select = None
  ):
      columns = []
      if query is not None:
          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
      else:
          columns = self.get_columns()
  
      columns = [name.lower() for name in columns]
  
      if len(result) == 0:
          result = pd.DataFrame([], columns=columns)
      else:
          for col in set(columns) & set(result.columns) ^ set(columns):
              result[col] = None
          result = result[columns]
  
      if query is not None and query.limit is not None:
          return result.head(query.limit.value)
  
      return result
  
file_path: mindsdb/mindsdb/integrations/handlers/plaid_handler/plaid_tables.py
imports: import pandas
  from mindsdb.integrations.libs.api_handler import APITable
  from mindsdb.integrations.utilities.sql_utils import extract_comparison_conditions
  from mindsdb_sql.parser import ast
label_desc: Use image node_id 3 for calling the BalanceTable obj's underlying member method code with example usage: obj.filter_columns(result, query) and returns: result, result