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 2098659175,PR_kwDOAMm_X85k-T6b,8658,Stateful tests with Dataset,2448579,closed,0,,,8,2024-01-24T16:34:59Z,2024-04-03T21:29:38Z,2024-04-03T21:29:36Z,MEMBER,,0,pydata/xarray/pulls/8658,"I was curious to see if the hypothesis [stateful testing](https://hypothesis.readthedocs.io/en/latest/stateful.html) would catch an inconsistent sequence of index manipulation operations like #8646. Turns out `rename_vars` is basically broken? (filed #8659) :P PS: this [blog post](https://hypothesis.works/articles/how-not-to-die-hard-with-hypothesis/) is amazing. ``` E state = DatasetStateMachine() E state.assert_invariants() E > === E E E Dimensions: () E Data variables: E *empty* E === E E E > vars: ('1', '1_') E state.add_dim_coord(var= E array([0], dtype=uint32)) E state.assert_invariants() E > === E E E Dimensions: (1: 1) E Coordinates: E * 1 (1) uint32 0 E Data variables: E 1_ (1) uint32 0 E === E E E > renaming 1 to 0 E state.rename_vars(newname='0') E state.assert_invariants() E > === E E E Dimensions: (1: 1) E Coordinates: E * 0 (1) uint32 0 E Dimensions without coordinates: 1 E Data variables: E 1_ (1) uint32 0 E === E E E state.teardown() ```","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8658/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 2098659703,I_kwDOAMm_X859FwF3,8659,renaming index variables with `rename_vars` seems buggy,2448579,closed,0,,,1,2024-01-24T16:35:18Z,2024-03-15T19:21:51Z,2024-03-15T19:21:51Z,MEMBER,,,,"### What happened? (xref #8658) I'm not sure what the expected behaviour is here: ```python import xarray as xr import numpy as np from xarray.testing import _assert_internal_invariants ds = xr.Dataset() ds.coords[""1""] = (""1"", np.array([1], dtype=np.uint32)) ds[""1_""] = (""1"", np.array([1], dtype=np.uint32)) ds = ds.rename_vars({""1"": ""0""}) ds ``` It looks like this sequence of operations creates a default index But then ```python from xarray.testing import _assert_internal_invariants _assert_internal_invariants(ds, check_default_indexes=True) ``` fails with ``` ... File ~/repos/xarray/xarray/testing/assertions.py:301, in _assert_indexes_invariants_checks(indexes, possible_coord_variables, dims, check_default) 299 if check_default: 300 defaults = default_indexes(possible_coord_variables, dims) --> 301 assert indexes.keys() == defaults.keys(), (set(indexes), set(defaults)) 302 assert all(v.equals(defaults[k]) for k, v in indexes.items()), ( 303 indexes, 304 defaults, 305 ) AssertionError: ({'0'}, set()) ``` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8659/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 2098626592,PR_kwDOAMm_X85k-Mnt,8657,groupby: Don't set `method` by default on flox>=0.9,2448579,closed,0,,,0,2024-01-24T16:20:57Z,2024-01-26T16:54:25Z,2024-01-26T16:54:23Z,MEMBER,,0,pydata/xarray/pulls/8657," - [x] Tests added - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst`","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8657/reactions"", ""total_count"": 2, ""+1"": 2, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull