Commit 910522f
fix(waterdata): small coherence cleanups (annotations, column order, defensiveness)
Five small, low-risk fixes surfaced by the package review:
1. get_latest_continuous / get_latest_daily: `value` was annotated `int`, but
every other getter (and the docstrings) use `str | Iterable[str]`; the `int`
hint also rejected the multi-value list filtering the others advertise.
2. get_time_series_metadata: `thresholds` was annotated `int`, vs
`float | list[float]` on get_combined_metadata for the same queryable.
3. _arrange_cols: the "move the synthetic per-record id column to the end" set
was a hand-maintained literal that omitted peak_id, channel_measurements_id,
combined_meta_id, and field_series_id, so those four getters left their id at
the front instead of the end like daily_id. Derive the set from
_OUTPUT_ID_BY_SERVICE (every output id except the user-facing
monitoring_location_id and time_series_id) so it stays in sync and can't
drift again when a service is added.
4. _next_req_url: returned a falsy `href` ("") instead of None, contradicting
its Optional[str] contract. Return None.
5. _get_resp_data (geopandas branch): mirror the non-geopandas branch's
`f.get("id")` so a feature missing a top-level id yields None rather than a
KeyError.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ee653e5 commit 910522f
2 files changed
Lines changed: 18 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
771 | | - | |
| 771 | + | |
772 | 772 | | |
773 | 773 | | |
774 | 774 | | |
| |||
1213 | 1213 | | |
1214 | 1214 | | |
1215 | 1215 | | |
1216 | | - | |
| 1216 | + | |
1217 | 1217 | | |
1218 | 1218 | | |
1219 | 1219 | | |
| |||
1407 | 1407 | | |
1408 | 1408 | | |
1409 | 1409 | | |
1410 | | - | |
| 1410 | + | |
1411 | 1411 | | |
1412 | 1412 | | |
1413 | 1413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
| |||
803 | 813 | | |
804 | 814 | | |
805 | 815 | | |
806 | | - | |
| 816 | + | |
807 | 817 | | |
808 | 818 | | |
809 | 819 | | |
| |||
905 | 915 | | |
906 | 916 | | |
907 | 917 | | |
908 | | - | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
909 | 921 | | |
910 | 922 | | |
911 | 923 | | |
| |||
1292 | 1304 | | |
1293 | 1305 | | |
1294 | 1306 | | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
1300 | | - | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
| 1307 | + | |
1304 | 1308 | | |
1305 | 1309 | | |
1306 | 1310 | | |
| |||
0 commit comments