<commit_before>module Dbcp
  class PostgresDatabase < Database
    def export_command(snapshot_file)
      build_password + [
        'pg_dump',
        '--host',     host,
        build_port,
        '--username', username,
        '--file',     snapshot_file.path,
        '--format',   'c',
        database
      ].flatten.shelljoin
    end

    def import_command(snapshot_file)
      build_password + [
        'pg_restore',
        '--host',     host,
        build_port,
        '--username', username,
        '--dbname',   database,
        '--clean',
        snapshot_file.path
      ].flatten.shelljoin
    end

    private

    def build_password
      %W[export PGPASSWORD=#{password}].shelljoin + '; '
    end

    def build_port
      ['--port', port] if host && port
    end

  end
end<commit_msg>fix 1.9.3<commit_after>module Dbcp
  class PostgresDatabase < Database
    def export_command(snapshot_file)
      build_password + [
        'pg_dump',
        '--host',     host,
        build_port,
        '--username', username,
        '--file',     snapshot_file.path,
        '--format',   'c',
        database
      ].flatten.compact.shelljoin
    end

    def import_command(snapshot_file)
      build_password + [
        'pg_restore',
        '--host',     host,
        build_port,
        '--username', username,
        '--dbname',   database,
        '--clean',
        snapshot_file.path
      ].flatten.compact.shelljoin
    end

    private

    def build_password
      %W[export PGPASSWORD=#{password}].shelljoin + '; '
    end

    def build_port
      ['--port', port] if host && port
    end

  end
end
{'fraction_non_alphanumeric': 0.12195121951219512, 'fraction_numerical': 0.001829268292682927, 'mean_word_length': 1.7626262626262625, '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': '2751380', 'n_tokens_mistral': 515, 'n_tokens_neox': 507, 'n_words': 104}