77from typing import Deque , Dict , List , Tuple , Union
88
99import polars as pl
10- from polars import DataFrame , LazyFrame , Utf8 , col , count # type: ignore
10+ from polars import DataFrame , LazyFrame , Utf8 , col # type: ignore
1111
1212from dve .core_engine .message import FeedbackMessage
1313from dve .parser .file_handling .service import open_stream
@@ -98,21 +98,21 @@ def create_error_dataframe(errors: Deque[FeedbackMessage], key_fields):
9898 schema = schema ,
9999 )
100100
101- df = df .with_columns (
102- pl .when (pl .col ("Status" ) == pl .lit ("error" ))
103- .then (pl .lit ("Submission Failure" ))
104- .otherwise (pl .lit ("Warning" ))
101+ df = df .with_columns ( # type: ignore
102+ pl .when (pl .col ("Status" ) == pl .lit ("error" )) # type: ignore
103+ .then (pl .lit ("Submission Failure" )) # type: ignore
104+ .otherwise (pl .lit ("Warning" )) # type: ignore
105105 .alias ("error_type" )
106106 )
107- df = df .select (
108- col ("Entity" ).alias ("Table" ),
109- col ("error_type" ).alias ("Type" ),
110- col ("ErrorCode" ).alias ("Error_Code" ),
111- col ("ReportingField" ).alias ("Data_Item" ),
112- col ("ErrorMessage" ).alias ("Error" ),
113- col ("Value" ),
114- col ("Key" ).alias ("ID" ),
115- col ("Category" ),
107+ df = df .select ( # type: ignore
108+ col ("Entity" ).alias ("Table" ), # type: ignore
109+ col ("error_type" ).alias ("Type" ), # type: ignore
110+ col ("ErrorCode" ).alias ("Error_Code" ), # type: ignore
111+ col ("ReportingField" ).alias ("Data_Item" ), # type: ignore
112+ col ("ErrorMessage" ).alias ("Error" ), # type: ignore
113+ col ("Value" ), # type: ignore
114+ col ("Key" ).alias ("ID" ), # type: ignore
115+ col ("Category" ), # type: ignore
116116 )
117117 return df .sort ("Type" , descending = False ).collect () # type: ignore
118118
@@ -133,23 +133,23 @@ def calculate_aggregates(error_frame: DataFrame) -> DataFrame:
133133 aggregates = (
134134 error_frame .group_by (
135135 [
136- pl .col ("Table" ),
137- pl .col ("Type" ),
138- pl .col ("Data_Item" ),
139- pl .col ("Error_Code" ),
140- pl .col ("Category" ),
136+ pl .col ("Table" ), # type: ignore
137+ pl .col ("Type" ), # type: ignore
138+ pl .col ("Data_Item" ), # type: ignore
139+ pl .col ("Error_Code" ), # type: ignore
140+ pl .col ("Category" ), # type: ignore
141141 ]
142142 )
143- .agg (pl .len ())
143+ .agg (pl .len ()) # type: ignore
144144 .select ( # type: ignore
145- pl .col ("Type" ),
146- pl .col ("Table" ),
147- pl .col ("Data_Item" ),
148- pl .col ("Category" ),
149- pl .col ("Error_Code" ),
150- pl .col ("len" ).alias ("Count" ),
145+ pl .col ("Type" ), # type: ignore
146+ pl .col ("Table" ), # type: ignore
147+ pl .col ("Data_Item" ), # type: ignore
148+ pl .col ("Category" ), # type: ignore
149+ pl .col ("Error_Code" ), # type: ignore
150+ pl .col ("len" ).alias ("Count" ), # type: ignore
151151 )
152- .sort (pl .col ("Type" ), pl .col ("Count" ), descending = [False , True ])
152+ .sort (pl .col ("Type" ), pl .col ("Count" ), descending = [False , True ]) # type: ignore
153153 )
154154 return aggregates
155155
0 commit comments