<commit_before>class Cranium::TestFramework::DatabaseTable

  def initialize(table_name, db_connection)
    @table_name, @db = table_name, db_connection
  end



  def create(fields)
    @db.run "CREATE TABLE #{@table_name} (#{fields.map { |field| "#{field["field_name"]} #{field["field_type"]}" }.join ", " })"
    self.class.tables_created << self
  end



  def destroy
    @db.run "DROP TABLE #{@table_name}"
  end



  def content(fields = ["*".to_sym])
    @db[@table_name].select(*fields).all
  end



  class << self

    def tables_created
      @tables_created ||= []
    end



    def cleanup
      tables_created.each { |table| table.destroy }
    end

  end

end<commit_msg>build fix (don't try to destroy non-existent database tables)<commit_after>class Cranium::TestFramework::DatabaseTable

  def initialize(table_name, db_connection)
    @table_name, @db = table_name, db_connection
  end



  def create(fields)
    @db.run "CREATE TABLE #{@table_name} (#{fields.map { |field| "#{field["field_name"]} #{field["field_type"]}" }.join ", " })"
    self.class.tables_created << self
  end



  def destroy
    @db.run "DROP TABLE #{@table_name}"
  end



  def content(fields = ["*".to_sym])
    @db[@table_name].select(*fields).all
  end



  class << self

    def tables_created
      @tables_created ||= []
    end



    def cleanup
      tables_created.each { |table| table.destroy }
      @tables_created = []
    end

  end

end
{'fraction_non_alphanumeric': 0.1419710544452102, 'fraction_numerical': 0.0, 'mean_word_length': 3.308605341246291, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '967696', 'n_tokens_mistral': 510, 'n_tokens_neox': 468, 'n_words': 108}