def read_schema(schema_csv):
  """Loads a database schema from a CSV representation."""
  tables = {}
  with gfile.Open(schema_csv) as infile:
    for column in csv.DictReader(
        infile,
        quotechar='"',
        delimiter=',',
        quoting=csv.QUOTE_ALL,
        skipinitialspace=True):
      column = {
          key.lower().strip(): value for key, value in column.items() if key
      }

      table_name = column['table name']
      if table_name != '-':
        if table_name not in tables:
          tables[table_name] = list()
        column.pop('table name')
        tables[table_name].append(column)
  return tables
Loads a database schema from a CSV representation.
language/xsp/data_preprocessing/michigan_preprocessing.py