parameters: (**kwargs)
return_statement: return setup_query_list, teardown_query_list
docstring: Get queries to run for setup and teardown from directory
  
        Kwargs:
          queries_dir(str): Directory with query files
          source_table(str): Table to run query against
          foreign_table_filename(str): File to create foreign table from
  
        Returns:
          setup_queries(query_list): List of setup queries
          teardown_queries(query_list): List of teardown queries
          False(bool): Unable to find queries dir
  
      query_list is described by:
      query_list(dict):::
          query_group(str): Query group, usually matches table name
          queries(list)
              query(dict):::
                  name(str): Name of query
                  mapdql(str): Query syntax to run
docstring_summary: Get queries to run for setup and teardown from directory
docstring_tokens: Get queries to run for setup and teardown from directory
function: def read_setup_teardown_query_files(**kwargs):
      """
        Get queries to run for setup and teardown from directory
  
        Kwargs:
          queries_dir(str): Directory with query files
          source_table(str): Table to run query against
          foreign_table_filename(str): File to create foreign table from
  
        Returns:
          setup_queries(query_list): List of setup queries
          teardown_queries(query_list): List of teardown queries
          False(bool): Unable to find queries dir
  
      query_list is described by:
      query_list(dict):::
          query_group(str): Query group, usually matches table name
          queries(list)
              query(dict):::
                  name(str): Name of query
                  mapdql(str): Query syntax to run
      """
      setup_teardown_queries_dir = kwargs['queries_dir']
      source_table = kwargs['source_table']
      # Read setup/tear-down queries if they exist
      setup_teardown_query_list = None
      if setup_teardown_queries_dir is not None:
          setup_teardown_query_list = read_query_files(
              queries_dir=setup_teardown_queries_dir,
              source_table=source_table
          )
          if kwargs["foreign_table_filename"] is not None:
              for query in setup_teardown_query_list['queries']:
                  query['mapdql'] = query['mapdql'].replace(
                      "##FILE##", kwargs["foreign_table_filename"])
      # Filter setup queries
      setup_query_list = None
      if setup_teardown_query_list is not None:
          setup_query_list = filter(
              lambda x: validate_setup_teardown_query_file(
                  query_filename=x['name'], check_which='setup', quiet=True),
              setup_teardown_query_list['queries'])
          setup_query_list = list(setup_query_list)
      # Filter teardown queries
      teardown_query_list = None
      if setup_teardown_query_list is not None:
          teardown_query_list = filter(
              lambda x: validate_setup_teardown_query_file(
                  query_filename=x['name'], check_which='teardown', quiet=True),
              setup_teardown_query_list['queries'])
          teardown_query_list = list(teardown_query_list)
      return setup_query_list, teardown_query_list
function_tokens: def read_setup_teardown_query_files ( * * kwargs ) : setup_teardown_queries_dir = kwargs [ 'queries_dir' ] source_table = kwargs [ 'source_table' ] # Read setup/tear-down queries if they exist setup_teardown_query_list = None if setup_teardown_queries_dir is not None : setup_teardown_query_list = read_query_files ( queries_dir = setup_teardown_queries_dir , source_table = source_table ) if kwargs [ "foreign_table_filename" ] is not None : for query in setup_teardown_query_list [ 'queries' ] : query [ 'mapdql' ] = query [ 'mapdql' ] . replace ( "##FILE##" , kwargs [ "foreign_table_filename" ] ) # Filter setup queries setup_query_list = None if setup_teardown_query_list is not None : setup_query_list = filter ( lambda x : validate_setup_teardown_query_file ( query_filename = x [ 'name' ] , check_which = 'setup' , quiet = True ) , setup_teardown_query_list [ 'queries' ] ) setup_query_list = list ( setup_query_list ) # Filter teardown queries teardown_query_list = None if setup_teardown_query_list is not None : teardown_query_list = filter ( lambda x : validate_setup_teardown_query_file ( query_filename = x [ 'name' ] , check_which = 'teardown' , quiet = True ) , setup_teardown_query_list [ 'queries' ] ) teardown_query_list = list ( teardown_query_list ) return setup_query_list , teardown_query_list