Skip to content

Commit 101d309

Browse files
fix: total no records rejected showing when it shouldn't (#194)
2 parents 2dc7a48 + 910fc14 commit 101d309

4 files changed

Lines changed: 31 additions & 7 deletions

File tree

‎docs/advanced_guidance/json_schemas/dataset.schema.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
},
1414
"entity_relationships": {
1515
"$ref": "entity_relationships.schema.json"
16+
},
17+
"error_report": {
18+
"$ref": "error_report.schema.json"
1619
}
1720
},
1821
"required": [
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "data-ingest:error_report.schema.json",
4+
"title": "error_report",
5+
"description": "Configuration for generating the error report.",
6+
"type": "object",
7+
"properties": {
8+
"record_rejection_reporting": {
9+
"description": "Whether to show/remove record rejection from the error report generated.",
10+
"type": "boolean",
11+
"default": true
12+
}
13+
},
14+
"additionalProperties": false
15+
}

‎src/dve/pipeline/pipeline.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,7 @@ def error_report(
10131013
if error_report_config.record_rejection_reporting
10141014
or e != ErrorReportCategories.RECORD_REJECTION
10151015
],
1016+
error_report_config=error_report_config,
10161017
)
10171018

10181019
workbook = er.ExcelFormat(

‎src/dve/reporting/excel_report.py‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from polars import DataFrame
1717
from polars.exceptions import ColumnNotFoundError
1818

19+
from dve.core_engine.configuration.v1 import V1ErrorReportConfig
1920
from dve.pipeline.utils import SubmissionStatus
2021
from dve.reporting.constants import ErrorReportCategories, ErrorReportStatus
2122

@@ -39,6 +40,8 @@ class SummaryItems:
3940
"""List of aggregations to apply to the grouped up dataframe"""
4041
additional_columns: Optional[list] = None
4142
"""any additional columns to add to the summary table"""
43+
error_report_config: V1ErrorReportConfig = field(default_factory=V1ErrorReportConfig)
44+
"""user specificed config to change elements of the error report"""
4245

4346
def create_summary_sheet(
4447
self,
@@ -160,13 +163,15 @@ def _add_submission_info(self, status: str, summary: Worksheet):
160163
_records_rejected = self.submission_status.number_of_records
161164
else:
162165
_records_rejected = self.submission_status.number_of_records_rejected
163-
summary.append(
164-
[
165-
"",
166-
"Total Number of Records Rejected",
167-
_records_rejected,
168-
]
169-
)
166+
167+
if self.error_report_config.record_rejection_reporting:
168+
summary.append(
169+
[
170+
"",
171+
"Total Number of Records Rejected",
172+
_records_rejected,
173+
]
174+
)
170175

171176
summary.append(["", ""])
172177

0 commit comments

Comments
 (0)