Commit afcbf62
fix(waterdata): drop id from wire
* fix(waterdata): drop id from the wire `properties` so daily/continuous don't 400
The USGS OGC API now rejects the feature `id` as a selectable `properties`
value on the `daily` and `continuous` collections (HTTP 400
"InvalidParameterValue. unknown properties specified"; `latest-daily` still
accepts it). `_switch_properties_id` translated the user-facing id column
(e.g. `daily_id`) to `id` and *kept* it in the wire `properties` list, so any
call passing the id column in `properties` started failing — breaking
`test_get_daily_properties` and `test_get_daily_properties_id`.
The feature `id` is always returned and is renamed to the service-specific id
column in `_arrange_cols`, so it never needs to be requested. Drop every id
alias (`id`, the service id like `daily_id`, and its singular form) plus
`geometry` (controlled by `skip_geometry`) from the wire list, matching the R
dataRetrieval package's `switch_properties_id`. User-facing behavior is
unchanged: callers still pass `daily_id`/`id` in `properties` and get the same
output columns; only the request the chunker sends is corrected.
Also update the stale `test_get_continuous` geometry assertion: with
`skip_geometry` unset the server now includes geometry by default, which the
library already documents ("the server defaults to including geometry"). The
user-facing default is intentionally left unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* refactor(waterdata): drop the dead service_id_singular branch in _switch_properties_id
Both callers pass id_name = _OUTPUT_ID_BY_SERVICE[service] (the canonical
service id column), so the `service.endswith("s")` singular-alias heuristic
never caught a real property the drop set was missing: where it produced a
meaningful name it equalled id_name already in the set, and otherwise it
produced non-existent forms (e.g. "continuou_id"). The drop set is now
{"id", "geometry", id_name, service_id}. Also fix the get_cql call-site
comment, which still described the pre-fix REPLACE behavior.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>properties so daily/continuous don't 400 (#323)1 parent 3e56b62 commit afcbf62
3 files changed
Lines changed: 33 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3007 | 3007 | | |
3008 | 3008 | | |
3009 | 3009 | | |
3010 | | - | |
3011 | | - | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
3012 | 3013 | | |
3013 | 3014 | | |
3014 | 3015 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
157 | 163 | | |
158 | 164 | | |
159 | 165 | | |
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
163 | 169 | | |
164 | | - | |
| 170 | + | |
165 | 171 | | |
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
171 | | - | |
| 177 | + | |
| 178 | + | |
172 | 179 | | |
173 | 180 | | |
174 | 181 | | |
175 | | - | |
176 | | - | |
177 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
178 | 186 | | |
179 | 187 | | |
180 | 188 | | |
181 | 189 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
192 | 198 | | |
193 | 199 | | |
194 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
| 474 | + | |
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
| |||
0 commit comments