Commit 342c4ed
committed
fix(golden): never write Infinity or NaN into a snapshot file
Symptom: after a pull request replaced DIVIDE() with the / operator and the
denominator collapsed to zero, 'semantic-diff snapshot' wrote a golden file containing
'"value": -Infinity'. Python read it back without complaint, so every local check
passed, but the file is not valid JSON: node, jq and any other consumer reject it. A
snapshot the CI job cannot parse is worse than no snapshot, because the gate reports a
tooling error instead of the regression that caused it.
Root cause: json.dumps emits the non standard literals Infinity, -Infinity and NaN by
default, and compute_snapshot passed the raw float through from DuckDB.
Fix: non finite results are recorded as blank with an explicit reason, which the
comparator already treats as a value movement, so the regression is still caught.1 parent ca85966 commit 342c4ed
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
129 | 147 | | |
130 | 148 | | |
131 | 149 | | |
| |||
0 commit comments