<commit_before>module GoodData::Bricks

  class ExecuteBrick < GoodData::Bricks::Brick

    def call(params)
      logger = params['GDC_LOGGER']
      metadata = params['metadata_wrapper']
      ads_wrapper = params['ads_storage_wrapper']
      raise Exception, "The schedule ID parameter need to be filled" if !params.include?("ID")
      metadata.set_integrator_context(params["ID"])
      ads_wrapper.connect
      # Lets check if the ADS gem is in batch mode or in entity mode
      integration_mode = ads_wrapper.get_mode
      if (integration_mode == :entity)
        entities = metadata.get_integrator_entities_ids
        entities.each do |entity_name|
          ads_wrapper.load_entity(entity_name)
        end
      elsif (integration_mode == :batch)
        batches = ads_wrapper.get_integration_batches
        batches.each do |batch_identification|
          ads_wrapper.load_batch(batch_identification)
        end
      else<commit_msg>Added minor changes to ADS integrator devel<commit_after>module GoodData::Bricks

  class ExecuteBrick < GoodData::Bricks::Brick

    def call(params)
      logger = params['GDC_LOGGER']
      metadata = params['metadata_wrapper']
      ads_wrapper = params['ads_storage_wrapper']
      raise Exception, "The schedule ID parameter need to be filled" if !params.include?("ID")
      metadata.set_integrator_context(params["ID"])
      ads_wrapper.connect
      # Lets check if the ADS gem is in batch mode or in entity mode
      integration_mode = ads_wrapper.get_mode
      if (integration_mode == :entity)
        entities = metadata.get_integrator_entities_ids

        entities.each do |entity_name|
          puts "processing entity #{entity_name}"
          ads_wrapper.load_entity(entity_name)
        end
      elsif (integration_mode == :batch)
        batches = ads_wrapper.get_integration_batches
        batches.each do |batch_identification|
          ads_wrapper.load_batch(batch_identification)
        end
      else
{'fraction_non_alphanumeric': 0.07715582450832073, 'fraction_numerical': 0.0, 'mean_word_length': 3.2033898305084745, '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': '1076403', 'n_tokens_mistral': 562, 'n_tokens_neox': 559, 'n_words': 137}