|
12 | 12 | _format_api_dates, |
13 | 13 | _get_args, |
14 | 14 | _handle_stats_nesting, |
15 | | - _type_cols, |
16 | 15 | _walk_pages, |
17 | 16 | ) |
18 | 17 |
|
@@ -293,27 +292,6 @@ def test_get_stats_data_warning_includes_next_token(caplog, monkeypatch): |
293 | 292 | assert any("tok2" in m for m in warnings_), warnings_ |
294 | 293 |
|
295 | 294 |
|
296 | | -def test_type_cols_value_is_always_float_even_for_whole_numbers(): |
297 | | - """Regression: ``pd.to_numeric`` infers ``int64`` when every value |
298 | | - is integer-shaped. The USGS API returns whole-CFS discharge as |
299 | | - string-typed integers at small streams (e.g. ``"12"`` for 12 cfs), |
300 | | - so ``_type_cols`` would coerce ``value`` to ``int64`` and a |
301 | | - downstream chained query mixing this site with another that has |
302 | | - fractional readings would surface a confusing dtype upcast. Force |
303 | | - ``float64`` for every physical-measurement column.""" |
304 | | - df = pd.DataFrame( |
305 | | - { |
306 | | - "value": ["12", "15", "18", "14", "11"], |
307 | | - "altitude": ["100", "200"] + [None] * 3, |
308 | | - "drainage_area": ["5", "10", "15", "20", "25"], |
309 | | - } |
310 | | - ) |
311 | | - out = _type_cols(df) |
312 | | - assert out["value"].dtype == "float64" |
313 | | - assert out["altitude"].dtype == "float64" |
314 | | - assert out["drainage_area"].dtype == "float64" |
315 | | - |
316 | | - |
317 | 295 | def test_handle_stats_nesting_tolerates_missing_drop_columns(): |
318 | 296 | """If the upstream stats response shape ever changes such that one of |
319 | 297 | the columns we try to drop ("type", "properties.data") is absent, the |
|
0 commit comments