4242from dve .parser .file_handling .implementations .file import LocalFilesystemImplementation
4343from dve .parser .file_handling .service import _get_implementation
4444from dve .pipeline .utils import SubmissionStatus , deadletter_file , load_config , load_reader
45+ from dve .reporting .constants import ErrorReportStatus
4546from dve .reporting .error_report import ERROR_SCHEMA , calculate_aggregates
4647
4748PERMISSIBLE_EXCEPTIONS : tuple [type [Exception ]] = (
@@ -764,8 +765,8 @@ def _get_error_dataframes(self, submission_id: str):
764765 pl .when (pl .col ("Status" ) == pl .lit ("informational" ))
765766 .then (pl .lit ("Warning" ))
766767 .when (pl .col ("FailureType" ) == pl .lit ("submission" )) # type: ignore
767- .then (pl .lit ("Submission Failure" )) # type: ignore
768- .otherwise (pl .lit ("Record Rejection" )) # type: ignore
768+ .then (pl .lit (ErrorReportStatus . FILE_REJECTION . reporting_name )) # type: ignore
769+ .otherwise (pl .lit (ErrorReportStatus . RECORD_REJECTION . reporting_name )) # type: ignore
769770 .alias ("error_type" ) # type: ignore
770771 )
771772 df = df .select (
@@ -828,9 +829,13 @@ def error_report(
828829 sub_stats = SubmissionStatisticsRecord (
829830 submission_id = submission_info .submission_id ,
830831 record_count = submission_status .number_of_records ,
831- number_submission_rejections = err_types .get ("Submission Failure" , 0 ),
832- number_record_rejections = err_types .get ("Record Rejection" , 0 ),
833- number_warnings = err_types .get ("Warning" , 0 ),
832+ number_submission_rejections = err_types .get (
833+ ErrorReportStatus .FILE_REJECTION .reporting_name , 0
834+ ),
835+ number_record_rejections = err_types .get (
836+ ErrorReportStatus .RECORD_REJECTION .reporting_name , 0
837+ ),
838+ number_warnings = err_types .get (ErrorReportStatus .WARNING .reporting_name , 0 ),
834839 )
835840
836841 summary_dict = {
@@ -841,7 +846,7 @@ def error_report(
841846 summary_items = er .SummaryItems (
842847 submission_status = submission_status ,
843848 summary_dict = summary_dict ,
844- row_headings = ["Submission Failure" , "Record Rejection" , "Warning" ],
849+ row_headings = [e . reporting_name for e in ErrorReportStatus ],
845850 )
846851
847852 workbook = er .ExcelFormat (
0 commit comments