issues: 2215603817
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2215603817 | I_kwDOAMm_X86ED25p | 8892 | ffill's tolerance argument can be strings | 14371165 | open | 0 | 1 | 2024-03-29T15:49:40Z | 2024-04-02T01:50:34Z | MEMBER | What happened?
But our typing assumes it's floats only: https://github.com/pydata/xarray/blob/2120808bbe45f3d4f0b6a01cd43bac4df4039092/xarray/core/resample.py#L69-L94 What did you expect to happen?Since our pytests pass, mypy should pass as well. Minimal Complete Verifiable Example```python import numpy as np import pandas as pd import xarray as xr https://github.com/pydata/xarray/blob/2120808bbe45f3d4f0b6a01cd43bac4df4039092/xarray/tests/test_groupby.py#L2016Test tolerance keyword for upsample methods bfill, pad, nearesttimes = pd.date_range("2000-01-01", freq="1D", periods=2) times_upsampled = pd.date_range("2000-01-01", freq="6h", periods=5) array = xr.DataArray(np.arange(2), [("time", times)]) Forward fillactual = array.resample(time="6h").ffill(tolerance="12h") expected = xr.DataArray([0.0, 0.0, 0.0, np.nan, 1.0], [("time", times_upsampled)]) xr.testing.assert_identical(expected, actual) ``` Environmentmaster |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/8892/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |