Skip to content

Commit 3b16f82

Browse files
committed
Add block range to batch log output
1 parent d32373b commit 3b16f82

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/kafka_streaming_loader.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ def stream_batches():
129129
):
130130
if result.success:
131131
batch_count += 1
132-
if batch_count == 1 and result.metadata:
133-
logger.info(f'First batch: {result.metadata.get("block_ranges")}')
134-
logger.info(f'Batch {batch_count}: {result.rows_loaded} rows in {result.duration:.2f}s')
132+
block_info = ''
133+
if result.metadata and result.metadata.get('block_ranges'):
134+
ranges = result.metadata['block_ranges']
135+
parts = [f'{r["network"]}:{r["start"]}-{r["end"]}' for r in ranges]
136+
block_info = f' [{", ".join(parts)}]'
137+
logger.info(f'Batch {batch_count}: {result.rows_loaded} rows in {result.duration:.2f}s{block_info}')
135138
else:
136139
logger.error(f'Batch error: {result.error}')
137140

0 commit comments

Comments
 (0)