<commit_before>class AddParsedUserAgentToOpenEvents < ActiveRecord::Migration
  def change
    add_column :open_events, :ua_family, :string
    add_column :open_events, :ua_version, :string
    add_column :open_events, :os_family, :string
    add_column :open_events, :os_version, :string

    OpenEvent.reset_column_information
    # Resaving open events so that the user agent parsing happens
    OpenEvent.find_each(batch_size: 500) do |open_event|
      open_event.save!
    end
  end
end<commit_msg>Display a running count of records<commit_after>class AddParsedUserAgentToOpenEvents < ActiveRecord::Migration
  def change
    add_column :open_events, :ua_family, :string
    add_column :open_events, :ua_version, :string
    add_column :open_events, :os_family, :string
    add_column :open_events, :os_version, :string

    OpenEvent.reset_column_information
    # Resaving open events so that the user agent parsing happens
    count = 0
    OpenEvent.find_each(batch_size: 500) do |open_event|
      open_event.save!
      count += 1
      p count if count % 100 == 0
    end
  end
end
{'fraction_non_alphanumeric': 0.0712979890310786, 'fraction_numerical': 0.010968921389396709, 'mean_word_length': 4.214285714285714, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6125660', 'n_tokens_mistral': 352, 'n_tokens_neox': 337, 'n_words': 94}