Repository navigation
Commit 19ae3d4
committed
fix(managed): read the run's warning defensively, and pin the fields
`warning_message` is read while building an error, which is the worst
place to assume an attribute: if an SDK release dropped it, the
`AttributeError` would replace a message naming the problem with one
naming nothing. `getattr` keeps the raise intact and loses only the
explanation.
Pinning the assumption is the better half of the fix, though. Every fake
in the managed-client tests is a `SimpleNamespace`, so nothing there
would notice a field being renamed or dropped -- the fakes would keep
answering and the suite would keep passing, with the cost landing at
runtime. A test now asserts the generated `QueryRunInfo` carries all four
fields this client reads off a run, not just the one that prompted this.1 parent b017161 commit 19ae3d4
2 files changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
202 | | - | |
| 206 | + | |
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
911 | 912 | | |
912 | 913 | | |
913 | 914 | | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
0 commit comments