chore: Add debug logging to ELABDATADISP consolidation

Added logging to track which nodes are being consolidated and how many
measurement categories each node has. This helps debug cases where data
appears to be lost during consolidation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-25 19:27:34 +01:00
parent 72035bb1b5
commit 648bd98a09

View File

@@ -402,6 +402,13 @@ class DataTransformer:
# Store measurements with node number as key # Store measurements with node number as key
consolidated_measurements[str(node_num)] = node_measurements consolidated_measurements[str(node_num)] = node_measurements
# Log consolidation to help debug
if len(group_rows) > 1:
logger.debug(
f"Consolidating node {node_num} for unit={key[0]}, tool={key[1]}, "
f"timestamp={key[3]}: {len(node_measurements)} measurement categories"
)
# Use the row with minimum id as template for other fields # Use the row with minimum id as template for other fields
min_id_row = min(group_rows, key=lambda r: r["idElabData"]) min_id_row = min(group_rows, key=lambda r: r["idElabData"])
# Use the row with maximum id for the consolidated row ID (for proper resume) # Use the row with maximum id for the consolidated row ID (for proper resume)