Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/advanced_guidance/json_schemas/dataset.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"entity_relationships": {
"$ref": "entity_relationships.schema.json"
},
"error_report": {
"$ref": "error_report.schema.json"
}
},
"required": [
Expand Down
15 changes: 15 additions & 0 deletions docs/advanced_guidance/json_schemas/error_report.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "data-ingest:error_report.schema.json",
"title": "error_report",
"description": "Configuration for generating the error report.",
"type": "object",
"properties": {
"record_rejection_reporting": {
"description": "Whether to show/remove record rejection from the error report generated.",
"type": "boolean",
"default": true
}
},
"additionalProperties": false
}
1 change: 1 addition & 0 deletions src/dve/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@ def error_report(
if error_report_config.record_rejection_reporting
or e != ErrorReportCategories.RECORD_REJECTION
],
error_report_config=error_report_config,
)

workbook = er.ExcelFormat(
Expand Down
19 changes: 12 additions & 7 deletions src/dve/reporting/excel_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from polars import DataFrame
from polars.exceptions import ColumnNotFoundError

from dve.core_engine.configuration.v1 import V1ErrorReportConfig
from dve.pipeline.utils import SubmissionStatus
from dve.reporting.constants import ErrorReportCategories, ErrorReportStatus

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

def create_summary_sheet(
self,
Expand Down Expand Up @@ -160,13 +163,15 @@ def _add_submission_info(self, status: str, summary: Worksheet):
_records_rejected = self.submission_status.number_of_records
else:
_records_rejected = self.submission_status.number_of_records_rejected
summary.append(
[
"",
"Total Number of Records Rejected",
_records_rejected,
]
)

if self.error_report_config.record_rejection_reporting:
summary.append(
[
"",
"Total Number of Records Rejected",
_records_rejected,
]
)

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

Expand Down
Loading