def WriteRow(self, values):
    """Writes a single row to the underlying buffer.

    Args:
      values: A dictionary mapping column names to values to be inserted into
        the CSV output.
    """
    precondition.AssertDictType(values, text, text)

    row = []
    for column in self._columns:
      try:
        value = values[column]
      except KeyError:
        raise ValueError("Row does not contain required column `%s`" % column)

      row.append(value)

    self._writer.WriteRow(row)