<commit_before>module Gitlab
  module ImportExport
    class AttributeCleaner
      IGNORED_REFERENCES = Gitlab::ImportExport::RelationFactory::PROJECT_REFERENCES + Gitlab::ImportExport::RelationFactory::USER_REFERENCES

      def self.clean!(relation_hash:)
        relation_hash.select! do |key, _value|
          IGNORED_REFERENCES.include?(key) || !key.end_with?('_id')
        end
      end
    end
  end
end<commit_msg>updated attribute cleaner to use allowed keyword and reject attributes<commit_after>module Gitlab
  module ImportExport
    class AttributeCleaner
      ALLOWED_REFERENCES = RelationFactory::PROJECT_REFERENCES + RelationFactory::USER_REFERENCES

      def self.clean!(relation_hash:)
        relation_hash.reject! do |key, _value|
          key.end_with?('_id') && !ALLOWED_REFERENCES.include?(key)
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08342989571263036, 'fraction_numerical': 0.0, 'mean_word_length': 3.8, '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': '6806452', 'n_tokens_mistral': 273, 'n_tokens_neox': 267, 'n_words': 52}