@@ -182,29 +182,29 @@ def as_dataframe(self) -> None:
182
182
column_tuples = set ()
183
183
data_rows = []
184
184
for record in self ._records :
185
- flat_record = {}
185
+ flat_record = {} # type: Dict[Union[str, Tuple[str, str]], Any]
186
186
187
187
input_data = record .get ("input_data" , {})
188
188
if isinstance (input_data , dict ):
189
- for k , v in input_data .items ():
190
- flat_record [("input_data" , k )] = v
191
- column_tuples .add (("input_data" , k ))
189
+ for input_data_col , input_data_val in input_data .items ():
190
+ flat_record [("input_data" , input_data_col )] = input_data_val
191
+ column_tuples .add (("input_data" , input_data_col ))
192
192
else :
193
- flat_record [("input_data" , "" )] = input_data # Use empty string for single input
193
+ flat_record [("input_data" , "" )] = input_data
194
194
column_tuples .add (("input_data" , "" ))
195
195
196
196
expected_output = record .get ("expected_output" , {})
197
197
if isinstance (expected_output , dict ):
198
- for k , v in expected_output .items ():
199
- flat_record [("expected_output" , k )] = v
200
- column_tuples .add (("expected_output" , k ))
198
+ for expected_output_col , expected_output_val in expected_output .items ():
199
+ flat_record [("expected_output" , expected_output_col )] = expected_output_val
200
+ column_tuples .add (("expected_output" , expected_output_col ))
201
201
else :
202
- flat_record [("expected_output" , "" )] = expected_output # Use empty string for single output
202
+ flat_record [("expected_output" , "" )] = expected_output
203
203
column_tuples .add (("expected_output" , "" ))
204
204
205
- for k , v in record .get ("metadata" , {}).items ():
206
- flat_record [("metadata" , k )] = v
207
- column_tuples .add (("metadata" , k ))
205
+ for metadata_col , metadata_val in record .get ("metadata" , {}).items ():
206
+ flat_record [("metadata" , metadata_col )] = metadata_val
207
+ column_tuples .add (("metadata" , metadata_col ))
208
208
209
209
data_rows .append (flat_record )
210
210
0 commit comments