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 1692597701,I_kwDOAMm_X85k4v3F,7808,Default behaviour of `min_count` wrong with flox,2448579,closed,0,,,0,2023-05-02T15:04:11Z,2023-05-10T02:39:45Z,2023-05-10T02:39:45Z,MEMBER,,,,"### What happened? ```python with xr.set_options(display_style=""text"", use_flox=False): with xr.set_options(use_flox=False): display( xr.DataArray( data=np.array([np.nan, 1, 1, np.nan, 1, 1]), dims=""x"", coords={""labels"": (""x"", np.array([1, 2, 3, 1, 2, 3]))}, ) .groupby(""labels"") .sum() ) with xr.set_options(use_flox=True): display( xr.DataArray( data=np.array([np.nan, 1, 1, np.nan, 1, 1]), dims=""x"", coords={""labels"": (""x"", np.array([1, 2, 3, 1, 2, 3]))}, ) .groupby(""labels"") .sum() ) ``` ``` # without flox array([0., 2., 2.]) Coordinates: * labels (labels) int64 1 2 3 # with flox array([nan, 2., 2.]) Coordinates: * labels (labels) int64 1 2 3 ``` ### What did you expect to happen? The same answer. We should set `min_count=0` when `min_count is None` ### Minimal Complete Verifiable Example _No response_ ### MVCE confirmation - [ ] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray. - [ ] Complete example — the example is self-contained, including all data and the text of any traceback. - [ ] Verifiable example — the example copy & pastes into an IPython prompt or [Binder notebook](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/blank_template.ipynb), returning the result. - [ ] New issue — a search of GitHub Issues suggests this is not a duplicate. ### Relevant log output _No response_ ### Anything else we need to know? _No response_ ### Environment
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/7808/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 1692612622,PR_kwDOAMm_X85PmMOy,7809,Fix `min_count` behaviour with flox.,2448579,closed,0,,,0,2023-05-02T15:13:17Z,2023-05-10T02:39:45Z,2023-05-10T02:39:43Z,MEMBER,,0,pydata/xarray/pulls/7809," - [x] Closes #7808 - [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/7809/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull