Commit 129229d
Address Copilot review on PR #229
1. TypeError messages now use a fixed example ("USGS-01646500") instead
of interpolating the user's value into the suggestion template.
The offending value is still surfaced via "(got {value!r})" so the
user can see what they actually passed — but mappings, large objects,
etc. no longer produce ugly suggestion strings like "USGS-{'k': 'v'}".
2. _MONITORING_LOCATION_ID_RE switched from anchored `^.+-.+$` matched
with `re.match` to un-anchored `.+-.+` matched with `re.fullmatch`.
Same effective behavior, but `fullmatch` makes the intent explicit
and removes the redundant anchor characters.
3. Widened the type annotations on all 10 public waterdata functions
that accept `monitoring_location_id` from `str | list[str] | None`
to `str | Iterable[str] | None`, matching the runtime contract that
accepts tuples, pandas.Series, pandas.Index, numpy.ndarray, etc.
Added `from collections.abc import Iterable` to api.py.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 38e0483 commit 129229d
2 files changed
Lines changed: 18 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | | - | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
414 | 415 | | |
415 | 416 | | |
416 | 417 | | |
417 | | - | |
| 418 | + | |
418 | 419 | | |
419 | 420 | | |
420 | 421 | | |
| |||
713 | 714 | | |
714 | 715 | | |
715 | 716 | | |
716 | | - | |
| 717 | + | |
717 | 718 | | |
718 | 719 | | |
719 | 720 | | |
| |||
937 | 938 | | |
938 | 939 | | |
939 | 940 | | |
940 | | - | |
| 941 | + | |
941 | 942 | | |
942 | 943 | | |
943 | 944 | | |
| |||
1117 | 1118 | | |
1118 | 1119 | | |
1119 | 1120 | | |
1120 | | - | |
| 1121 | + | |
1121 | 1122 | | |
1122 | 1123 | | |
1123 | 1124 | | |
| |||
1299 | 1300 | | |
1300 | 1301 | | |
1301 | 1302 | | |
1302 | | - | |
| 1303 | + | |
1303 | 1304 | | |
1304 | 1305 | | |
1305 | 1306 | | |
| |||
1816 | 1817 | | |
1817 | 1818 | | |
1818 | 1819 | | |
1819 | | - | |
| 1820 | + | |
1820 | 1821 | | |
1821 | 1822 | | |
1822 | 1823 | | |
| |||
1941 | 1942 | | |
1942 | 1943 | | |
1943 | 1944 | | |
1944 | | - | |
| 1945 | + | |
1945 | 1946 | | |
1946 | 1947 | | |
1947 | 1948 | | |
| |||
2066 | 2067 | | |
2067 | 2068 | | |
2068 | 2069 | | |
2069 | | - | |
| 2070 | + | |
2070 | 2071 | | |
2071 | 2072 | | |
2072 | 2073 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1153 | 1153 | | |
1154 | 1154 | | |
1155 | 1155 | | |
1156 | | - | |
| 1156 | + | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | 1159 | | |
| |||
1198 | 1198 | | |
1199 | 1199 | | |
1200 | 1200 | | |
1201 | | - | |
1202 | | - | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1203 | 1204 | | |
1204 | 1205 | | |
1205 | 1206 | | |
1206 | 1207 | | |
1207 | 1208 | | |
1208 | 1209 | | |
1209 | 1210 | | |
1210 | | - | |
1211 | | - | |
| 1211 | + | |
| 1212 | + | |
1212 | 1213 | | |
1213 | 1214 | | |
1214 | 1215 | | |
1215 | 1216 | | |
1216 | 1217 | | |
1217 | 1218 | | |
1218 | 1219 | | |
1219 | | - | |
| 1220 | + | |
1220 | 1221 | | |
1221 | 1222 | | |
1222 | 1223 | | |
| |||
0 commit comments