Commit 22b3e03
committed
Improved error message when subscripting types that don't support it
For example, `fig.update_layout(width_x=1)` gives the following error
message:
TypeError: 'NoneType' object is not subscriptable
Invalid value received for the 'width' property of layout
The 'width' property is a number and may be specified as:
- An int or float in the interval [10, inf]
Property does not support subscripting:
width_x
~~~~~
because `fig.layout['width']` can't be subscripted (you can't do
`fig.layout['width']['x'] = 1`)1 parent 5695969 commit 22b3e03
File tree
2 files changed
+34
-1
lines changed- packages/python/plotly/plotly
- tests/test_core/test_errors
2 files changed
+34
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
| 124 | + | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
130 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
131 | 144 | | |
132 | 145 | | |
133 | 146 | | |
134 | 147 | | |
| 148 | + | |
135 | 149 | | |
136 | 150 | | |
137 | 151 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
295 | 304 | | |
296 | 305 | | |
297 | 306 | | |
| |||
328 | 337 | | |
329 | 338 | | |
330 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
331 | 347 | | |
332 | 348 | | |
333 | 349 | | |
| |||
345 | 361 | | |
346 | 362 | | |
347 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
0 commit comments