Skip to content

Commit da3e754

Browse files
committed
future-proof iter for streaming
1 parent aad4b18 commit da3e754

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Lib/profiling/sampling/jsonl_collector.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,13 @@ def _normalize_export_location(location):
190190
return normalized
191191

192192
def _iter_final_agg_entries(self):
193-
return [
194-
{
195-
"frame_id": frame_record["frame_id"],
196-
"self": self._frame_self[frame_record["frame_id"]],
197-
"cumulative": self._frame_cumulative[frame_record["frame_id"]],
193+
for frame_record in self._frames:
194+
frame_id = frame_record["frame_id"]
195+
yield {
196+
"frame_id": frame_id,
197+
"self": self._frame_self[frame_id],
198+
"cumulative": self._frame_cumulative[frame_id],
198199
}
199-
for frame_record in self._frames
200-
]
201200

202201
def _write_chunked_records(
203202
self, output, base_record, chunk_field, entries

0 commit comments

Comments
 (0)