home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 1118802352

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
1118802352 PR_kwDOAMm_X84xzhTi 6212 better warning filter for assert_* 10194086 closed 0     1 2022-01-31T00:22:37Z 2022-09-05T07:52:09Z 2022-09-05T07:52:06Z MEMBER   0 pydata/xarray/pulls/6212

In #4864 I added a a decorator for the xarray.testing.assert_* functions to ensure warnings that were to errors (pytest.mark.filterwarnings("error")) do not error in assert_* (see https://github.com/pydata/xarray/pull/4760#issuecomment-774101639). As a solution I added

https://github.com/pydata/xarray/blob/5470d933452d88deb17cc9294a164c4a03f55dec/xarray/testing.py#L32

However, this is sub-optimal because this now removes all ignore filters! As dask stuff only gets evaluated in assert_* filters like warnings.filterwarnings("ignore", "Mean of empty slice") don't work for dask arrays!

I thought of setting

python warnings.simplefilter("ignore")

but this could suppress warnings we want to keep.

So now I remove all "error" warning filters and keep the rest. Note that the original filters get restored after with warnings.catch_warnings():. ().


I am not sure I expressed myself very clearly... let me know and I can try again. @keewis you had a look at #4864 maybe you can review this PR as well?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6212/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 1 row from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.74ms · About: xarray-datasette