Commit 1d7a6e7
committed
Allow int-valued list filters in _get_args (water_year, year, month, day, peak_since)
`get_peaks` (merged in fca3d6c) introduced five `int | list[int] | None`
filters. The prior commit removed `_get_args`'s "list-of-non-str
pass-through" clause to catch user errors like `parameter_code=[60, 65]`
client-side — but the same clause was the only thing letting
`water_year=[2020]` through. CI surfaced this via
`test_get_peaks_water_year_filter`.
Add the five known int-list filter names to `_NO_NORMALIZE_PARAMS` so
they bypass string-iterable normalization. Existing string-list params
still validate, and `parameter_code=[60, 65]` still raises TypeError
client-side as intended.
If future int-list params are added, they must be opted in here — this
is intentional: the cost of one line per new param is a fair price for
not silently passing user errors to the API.1 parent 8dc70b2 commit 1d7a6e7
1 file changed
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
1188 | | - | |
1189 | | - | |
1190 | | - | |
1191 | | - | |
1192 | | - | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1193 | 1194 | | |
1194 | 1195 | | |
1195 | 1196 | | |
1196 | 1197 | | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
1197 | 1203 | | |
1198 | 1204 | | |
1199 | 1205 | | |
| |||
0 commit comments