<commit_before># encoding: utf-8
require 'uuidtools'
require_relative '../../../track_record/track_record'

module CartoDB
  module Importer
    class Job
      def initialize(attributes={})
        @id         = attributes.fetch(:id, UUIDTools::UUID.timestamp_create)
        @logger     = attributes.fetch(:logger, TrackRecord::Log.new)
        @pg_options = attributes.fetch(:pg_options, {})
      end #initalize

      def log(message)
        logger.append(message)
      end #log

      attr_reader :id, :logger, :pg_options
    end # Job
  end # Importer
end # CartoDB<commit_msg>[importer] Implement Job#table_name and Job#dataset<commit_after># encoding: utf-8
require 'pg'
require 'sequel'
require 'uuidtools'
require_relative '../../../track_record/track_record'

module CartoDB
  module Importer
    class Job
      def initialize(attributes={})
        @id         = attributes.fetch(:id, UUIDTools::UUID.timestamp_create.to_s)
        @logger     = attributes.fetch(:logger, TrackRecord::Log.new)
        @pg_options = attributes.fetch(:pg_options, {})
      end #initalize

      def log(message)
        logger.append(message)
      end #log

      def table_name
        "importer_#{id.gsub(/-/, '')}"
      end #table_name

      def dataset
        Sequel.postgres(pg_options)[table_name.to_sym]
      end #datset

      attr_reader :id, :logger, :pg_options
    end # Job
  end # Importer
end # CartoDB
{'fraction_non_alphanumeric': 0.11884669479606189, 'fraction_numerical': 0.0014064697609001407, 'mean_word_length': 2.8150134048257374, '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': '6120956', 'n_tokens_mistral': 440, 'n_tokens_neox': 441, 'n_words': 97}