<commit_before>require 'supermarket/community_site/pool'

module Supermarket
  module Import
    module Configuration
      def basic_import(record_type_name)
        define_method(:record_type) do
          Supermarket::CommunitySite.const_get(record_type_name)
        end

        define_method(:each) do |&block|
          record_type.each(&block)
        end

        define_method(:count) do
          record_type.count
        end

        define_method(:ids) do
          CommunitySite::Pool.with do |conn|
            conn.query("SELECT id FROM #{record_type.sadequate_table_name}")
          end.to_a.map { |result| result['id'].to_i }
        end
      end

      def list_ids_with(query)
        define_method(:ids) do
          CommunitySite::Pool.with do |conn|
            conn.query(query)
          end.to_a.map { |result| result['id'].to_i }
        end
      end

      def migrate(pathway)
        source = pathway.keys.first
        destination = pathway[source]

        define_method(:source_type) do
          Supermarket::CommunitySite.const_get(source)
        end
<commit_msg>Remove the basic_import Import macro<commit_after>require 'supermarket/community_site/pool'

module Supermarket
  module Import
    module Configuration
      def list_ids_with(query)
        define_method(:ids) do
          CommunitySite::Pool.with do |conn|
            conn.query(query)
          end.to_a.map { |result| result['id'].to_i }
        end
      end

      def migrate(pathway)
        source = pathway.keys.first
        destination = pathway[source]

        define_method(:source_type) do
          Supermarket::CommunitySite.const_get(source)
        end

{'fraction_non_alphanumeric': 0.08700834326579261, 'fraction_numerical': 0.0, 'mean_word_length': 2.2857142857142856, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7543902', 'n_tokens_mistral': 492, 'n_tokens_neox': 473, 'n_words': 95}