|
7 | 7 |
|
8 | 8 | import hashprep |
9 | 9 |
|
| 10 | +from .base import BaseReport |
10 | 11 |
|
11 | | -class HtmlReport: |
12 | | - ALERT_TYPE_MAPPING = { |
13 | | - "feature_correlation": "High Correlation", |
14 | | - "categorical_correlation": "High Correlation", |
15 | | - "mixed_correlation": "High Correlation", |
16 | | - "missing_values": "Missing", |
17 | | - "high_missing_values": "Missing", |
18 | | - "dataset_missingness": "Missing", |
19 | | - "missing_patterns": "Missing", |
20 | | - "uniform_distribution": "Uniform", |
21 | | - "unique_values": "Unique", |
22 | | - "high_zero_counts": "Zeros", |
23 | | - "outliers": "Outliers", |
24 | | - "skewness": "Skewness", |
25 | | - "high_cardinality": "High Cardinality", |
26 | | - "duplicates": "Duplicates", |
27 | | - "data_leakage": "Leakage", |
28 | | - "target_leakage_patterns": "Leakage", |
29 | | - "class_imbalance": "Imbalance", |
30 | | - "empty_columns": "Empty", |
31 | | - "single_value_columns": "Constant", |
32 | | - "mixed_data_types": "Mixed Types", |
33 | | - "extreme_text_lengths": "Text Length", |
34 | | - "datetime_skew": "DateTime Skew", |
35 | | - "dataset_drift": "Drift", |
36 | | - "infinite_values": "Infinite", |
37 | | - "constant_length": "Constant Length", |
38 | | - "empty_dataset": "Empty Dataset", |
39 | | - } |
40 | 12 |
|
| 13 | +class HtmlReport(BaseReport): |
41 | 14 | def generate(self, summary, full=False, output_file=None, theme="minimal", pdf_mode=False): |
42 | 15 | template_str = self._get_template(theme) |
43 | 16 | template = Template(template_str) |
@@ -101,18 +74,6 @@ def generate(self, summary, full=False, output_file=None, theme="minimal", pdf_m |
101 | 74 | f.write(html_content) |
102 | 75 | return html_content |
103 | 76 |
|
104 | | - def _group_alerts_by_type(self, issues: list[dict]) -> dict[str, list[dict]]: |
105 | | - """Group issues into display categories for the alerts section.""" |
106 | | - groups: dict[str, list[dict]] = {} |
107 | | - |
108 | | - for issue in issues: |
109 | | - alert_type = self.ALERT_TYPE_MAPPING.get(issue["category"], "Other") |
110 | | - if alert_type not in groups: |
111 | | - groups[alert_type] = [] |
112 | | - groups[alert_type].append(issue) |
113 | | - |
114 | | - return groups |
115 | | - |
116 | 77 | def _generate_config(self, summary) -> dict: |
117 | 78 | """Generate configuration dict for download.""" |
118 | 79 | reproduction_info = summary["summaries"].get("reproduction_info", {}) |
|
0 commit comments