Commit 3274d91
fix(waterdata): repair queryables fallback, scalar properties, sediment unit
Review fixes for the hash-drop path:
* get_ogc_data's queryables-fallback except caught requests.HTTPError /
requests.RequestException, but the module imports only httpx (no requests
import), so any queryables failure raised NameError instead of falling
back. Catch (httpx.HTTPError, RuntimeError, ValueError) -- the types the
path actually raises (RateLimited/ServiceUnavailable subclass RuntimeError).
* Guard _service_queryables against a non-dict 200 body so a malformed
response falls back (caught ValueError) rather than escaping as
AttributeError.
* Normalize a scalar-string `properties` to a list at the get_ogc_data
boundary, so get_reference_table's raw query dict can't trip
`all(pd.isna("..."))` (TypeError) or a per-character set in _arrange_cols.
* CF_UNIT_MAP: "tons/day" -> "ton day-1" ("short_ton" is not a valid UDUNITS
name; UDUNITS "ton" is the US short ton).
Add regression tests for the queryables fallback and scalar-properties paths.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c58e96e commit 3274d91
3 files changed
Lines changed: 64 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
252 | 251 | | |
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
256 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
| |||
1427 | 1431 | | |
1428 | 1432 | | |
1429 | 1433 | | |
1430 | | - | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
1431 | 1439 | | |
| 1440 | + | |
| 1441 | + | |
1432 | 1442 | | |
1433 | 1443 | | |
1434 | 1444 | | |
| |||
1441 | 1451 | | |
1442 | 1452 | | |
1443 | 1453 | | |
1444 | | - | |
| 1454 | + | |
1445 | 1455 | | |
1446 | 1456 | | |
1447 | 1457 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
0 commit comments