Beispiel #1
0
 def compare_with_customized_rules(self, source_items, target_items, tagged_fields):
     if not target_items:
         return
     self.save_result(
         category_rules.get_difference(
             source_items.key,
             target_items.key,
             source_items.df,
             target_items.df,
             tagged_fields.get("category", []),
         )
     )
     self.save_result(
         price_rules.compare_prices_for_same_urls(
             source_items.df, target_items.df, tagged_fields
         )
     )
     self.save_result(
         price_rules.compare_names_for_same_urls(
             source_items.df, target_items.df, tagged_fields
         )
     )
     self.save_result(
         price_rules.compare_prices_for_same_names(
             source_items.df, target_items.df, tagged_fields
         )
     )
Beispiel #2
0
def test_get_difference(source, target, categories, expected_messages,
                        expected_stats):
    assert_results_equal(
        c.get_difference(pd.DataFrame(source), pd.DataFrame(target),
                         categories),
        create_result("Category Coverage Difference",
                      expected_messages,
                      stats=expected_stats),
    )
Beispiel #3
0
 def compare_with_customized_rules(self, source_items, target_items,
                                   tagged_fields):
     if not target_items:
         return
     self.save_result(
         category_rules.get_difference(
             source_items.df,
             target_items.df,
             tagged_fields.get("category", []) + self.schema.enums,
         ))
     for r in [
             price_rules.compare_prices_for_same_urls,
             price_rules.compare_names_for_same_urls,
             price_rules.compare_prices_for_same_names,
     ]:
         self.save_result(r(source_items.df, target_items.df,
                            tagged_fields))