Beispiel #1
0
 def run_general_rules(self):
     self.save_result(garbage_symbols(self.source_items))
     self.save_result(
         coverage_rules.check_fields_coverage(
             self.source_items.df.drop(columns=["_type", "_key"])
         )
     )
Beispiel #2
0
 def run_general_rules(self):
     self.save_result(garbage_symbols(self.source_items.df))
     df = self.source_items.df
     self.save_result(
         coverage_rules.check_fields_coverage(
             df.drop(columns=df.columns[df.columns.str.startswith("_")])))
     self.save_result(category_rules.get_categories(df))
Beispiel #3
0
 def run_general_rules(self):
     self.save_result(garbage_symbols(self.source_items.df))
     df = self.source_items.df
     self.save_result(
         coverage_rules.check_fields_coverage(
             df.drop(columns=df.columns[df.columns.str.startswith("_")])))
     self.save_result(category_rules.get_categories(df))
     if getattr(self, "uniques", None):
         self.save_result(
             duplicate_rules.find_by(self.source_items.df, self.uniques))
Beispiel #4
0
 def scraped_fields_coverage(self, df: pd.DataFrame) -> None:
     coverage_res = self.report.results.get(
         "Fields Coverage", coverage_rules.check_fields_coverage(df))
     self.figures.extend(coverage_res.figures)
Beispiel #5
0
def test_check_fields_coverage(df, expected_messages, expected_stats):
    result = cov.check_fields_coverage(df)
    assert result == create_result("Fields Coverage", expected_messages,
                                   expected_stats)
Beispiel #6
0
def test_check_fields_coverage(df, expected_messages, expected_stats):
    assert_results_equal(
        cov.check_fields_coverage(df),
        create_result("Fields Coverage", expected_messages, expected_stats),
    )
Beispiel #7
0
 def run_general_rules(self):
     self.save_result(garbage_symbols(self.source_items))
     self.save_result(
         coverage_rules.check_fields_coverage(self.source_items.df))