You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per Copilot review: the function's name and narrative docstring both
promise a Watershed, but the actual contract was three different return
types selected by `format` (Response, dict, Watershed) — and the default
returned a `requests.Response`, contradicting the narrative.
Drop the `format` parameter and always return a `Watershed`. Extract the
HTTP+parse into a private `_fetch_streamstats_json` helper that both
`get_watershed` and `Watershed.__init__` use, so they share fetch logic
without circular calls. The narrative docstring now matches the
contract.
Also drop dead commented-out lines in `download_workspace` while in
the file.
Breaking change for callers using `format="geojson"`/`"object"`/etc.
Callers needing the raw JSON or Response can use
`Watershed.from_streamstats_json(...)` and `requests.get(...)` directly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments