vc_014 · Entity table with duplicate keys (fail-fast)
Status: ✓ Passing · Last run: 2026-06-04T23:42:11 · Pipeline: v2
· History: 3/3 runs passed (100%)
What was tested
Reproduces the failure mode of run_id 5331dea4c43c447dac1dcea45b078412: the entity table itself has duplicate entity-id rows (1000 total rows but only ~940 distinct entity_id values), causing the v2 pipeline's fans_out detector to flag the entity table as event-stream — at which point the feature_plan LLM has no good way to encode features and loops through 3 invalid plans before giving up with an unhelpful RuntimeError 14 minutes in. The fix in pipeline._validate_entity_table_grain catches this at intent_classification (~30s in) and halts with a customer-actionable error: "Your
| Status | Assertion | Detail |
|---|---|---|
| ✓ | pipeline_halted_with |
halted with text containing 'entity': 'RuntimeError: Your src_vc_014 table has 1060 rows but only 1000 distinct entity_id values (60 … |
| ✓ | pipeline_halted_with |
halted with text containing 'entity': 'RuntimeError: Your src_vc_014 table has 1060 rows but only 1000 distinct entity_id values (60 … |
| ✓ | no_model_produced |
no model produced — pipeline correctly refused to train |
How this could have gone wrong
- If
pipeline_halted_withfailed: Pipeline must halt with a message containing "duplicate" — the key signal that the entity-grain validator caught the dirty data. Without this exact string the customer wouldn't know what to fix. - If
pipeline_halted_withfailed: The halt message must also reference "entity" — pinning the diagnosis at the entity table specifically, not some generic "validation failed" message. - If
no_model_producedfailed: No model should be trained on dirty entity data. If a model slips out despite the halt, the message would be a polite lie and the model would be on inflated rows (60 of 1000 entities double-counted in training).
Why this case matters
Patient-shaped datasets (each entity has demographics + some history) routinely arrive with dup entity rows from append-only loaders or re-imports. Before the fix this caused a 14-minute thrash with no customer-actionable error. This case is the floor that prevents the same UX regression — any future refactor of intent_classification that drops the dup-key check fails this case loudly.
Reproducing
# from auto_insight_api/
python -m validation.v2 run vc_014 --pipeline v2 -v
- Case config:
validation/v2/cases/14_entity_with_duplicates.yaml - Data shape:
entity_with_duplicates - Analytics type:
ml_binary - Related: v2 run 5331dea4c43c447dac1dcea45b078412 (2026-06-01)