Repository navigation
Commit a182e2c
committed
fix(gooddata-eval): reject malformed alert group-by arguments (GDAI-2175)
`actual_args.get("attributes") or []` collapsed a falsy non-list -- `{}`,
`""`, `0` -- into "no grouping", so those passed an `Attributes: []`
expectation. `_attribute_label_ids` also never checked that its input was a
list, so a truthy non-list was iterated instead: a dict yields its keys, a
string yields its characters. That produced a false pass, an actual of
`"x"` scoring correct against an expectation of `[{"using": "label/x"}]`.
The two malformations are not the same kind of event, and the split is
structural rather than by side:
- Not a list of groupings at all -> False. The agent answered wrongly, and a
wrong answer is a FAIL. Raising would record an ERROR, which
`json_report.py` excludes from the failure count, so a malformed answer
would rank above a merely wrong one.
- A list holding an unreadable entry -> raises, as before. Entries are typed
`AttributeItem` at the tool boundary, so the plausible cause is the wire
format moving, and that has to be unmissable rather than read as every
agent regressing at once.
The expectation side needs no equivalent guard: `_normalize_expected_output`
already rejects a non-list before the run starts, and `from_dict`, the other
way into the field, has no callers.
risk: low1 parent b090999 commit a182e2c
2 files changed
Lines changed: 29 additions & 1 deletion
File tree
- packages/gooddata-eval
- src/gooddata_eval/core/agentic
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| |||
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
177 | | - | |
178 | 179 | | |
179 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
180 | 193 | | |
181 | 194 | | |
182 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
846 | 861 | | |
847 | 862 | | |
848 | 863 | | |
| |||
0 commit comments