Commit f3d1e8f
Make
Previously `get_watershed` had two named formats (`"geojson"`, `"object"`)
and any other value silently fell through to a `Watershed` — the same
bug shape that masked the dead `"shape"` branch removed earlier in this
PR. Add an explicit `"watershed"` case and raise `ValueError` on
unrecognized values so a typo'd format fails loudly instead of
returning whatever the fallthrough is.
Also fix `get_sample_watershed`, whose docstring promises a `Watershed`
but called `get_watershed(...)` with the default `format="geojson"`
(returns the raw `requests.Response`). Pass `format="watershed"`
explicitly so the function matches its documented return type.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>format contract explicit in get_watershed1 parent b325f92 commit f3d1e8f
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
| 109 | + | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
0 commit comments