Commit 0ccd573
fix(nwis): forward get_record
Three fixes in the (deprecated) nwis module:
1. get_record's `state` argument was accepted and documented but never
forwarded, so get_record(state="OH", service="site") silently ignored it and
failed with a confusing "Bad Request". Forward it as the NWIS `stateCd`
major filter.
2. get_dv / get_iv / get_discharge_peaks did
`kwargs["sites"] = kwargs.pop("sites", sites)`, always injecting the key (as
None when absent) and so defeating query_waterservices' "must specify a
major filter" check — get_dv()/get_iv() with no filter raised a confusing
"Bad Request" instead of the intended TypeError. Inject only when provided.
3. get_dv / get_iv passed `format="json"` explicitly alongside **kwargs, so
get_dv(sites=..., format="rdb") raised "got multiple values for 'format'".
These getters only parse JSON, so reject a non-json format with a clear
ValueError.
`wide_format` / `datetime_index` on get_record remain accepted but
unimplemented (unchanged here); wiring or removing them is a separate decision
for this deprecated module.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>state, restore major-filter check, clarify format1 parent ee653e5 commit 0ccd573
2 files changed
Lines changed: 66 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
133 | 144 | | |
134 | 145 | | |
135 | 146 | | |
| |||
276 | 287 | | |
277 | 288 | | |
278 | 289 | | |
279 | | - | |
| 290 | + | |
| 291 | + | |
280 | 292 | | |
281 | 293 | | |
282 | 294 | | |
| |||
534 | 546 | | |
535 | 547 | | |
536 | 548 | | |
537 | | - | |
| 549 | + | |
| 550 | + | |
538 | 551 | | |
539 | 552 | | |
| 553 | + | |
540 | 554 | | |
541 | 555 | | |
542 | 556 | | |
| |||
719 | 733 | | |
720 | 734 | | |
721 | 735 | | |
722 | | - | |
| 736 | + | |
| 737 | + | |
723 | 738 | | |
724 | 739 | | |
| 740 | + | |
725 | 741 | | |
726 | 742 | | |
727 | 743 | | |
| |||
952 | 968 | | |
953 | 969 | | |
954 | 970 | | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
955 | 977 | | |
956 | 978 | | |
957 | 979 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
123 | 164 | | |
124 | 165 | | |
125 | 166 | | |
| |||
0 commit comments