<commit_before>module DatastaxRails
  module Connection
    extend ActiveSupport::Concern
    
    included do
      class_attribute :connection
    end

    module ClassMethods
      DEFAULT_OPTIONS = {
        :servers => "127.0.0.1:9160",
        :thrift => {}
      }
      def establish_connection(spec)
        DatastaxRails::Base.config = spec.with_indifferent_access
        spec.reverse_merge!(DEFAULT_OPTIONS)
        self.connection = CassandraCQL::Database.new(spec[:servers], :keyspace => spec[:keyspace])
      end
    end
  end<commit_msg>Provide ability to specify thrift connection options from YAML file<commit_after>module DatastaxRails
  module Connection
    extend ActiveSupport::Concern
    
    included do
      class_attribute :connection
    end

    module ClassMethods
      DEFAULT_OPTIONS = {
        :servers => "127.0.0.1:9160",
        :thrift => {}
      }
      def establish_connection(spec)
        DatastaxRails::Base.config = spec.with_indifferent_access
        spec.reverse_merge!(DEFAULT_OPTIONS)
        connection_options = spec[:connection_options] || {}
        self.connection = CassandraCQL::Database.new(spec[:servers], {:keyspace => spec[:keyspace]}, connection_options.symbolize_keys)
      end
    end
  end
{'fraction_non_alphanumeric': 0.09206349206349207, 'fraction_numerical': 0.015873015873015872, 'mean_word_length': 3.003174603174603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2864726', 'n_tokens_mistral': 371, 'n_tokens_neox': 362, 'n_words': 69}