{"database": "github", "table": "issues", "is_view": false, "human_description_en": "where \"closed_at\" is on date 2019-02-19, state_reason = \"completed\" and user = 35968931 sorted by updated_at descending", "rows": [[409854736, "MDU6SXNzdWU0MDk4NTQ3MzY=", 2768, "[Bug] Reduce fails when no axis given", 35968931, "closed", 0, null, null, 1, "2019-02-13T15:16:45Z", "2019-02-19T06:13:00Z", "2019-02-19T06:12:59Z", "MEMBER", null, null, null, "`DataArray.reduce()` fails if you try to reduce using a function which doesn't accept any axis arguments.\r\n\r\n```python\r\nimport numpy as np\r\nfrom xarray import DataArray\r\n\r\nda = DataArray(np.array([[1, 3, 3], [2, 1, 5]]))\r\n\r\ndef total_sum(data):\r\n    return np.sum(data.flatten())\r\n\r\nsum = da.reduce(total_sum)\r\nprint(sum)\r\n```\r\n\r\nThis should print a dataarray with just the number 15 in it, but instead it throws the error\r\n```\r\nTraceback (most recent call last):\r\n  File \"mwe.py\", line 9, in <module>\r\n    sum = da.reduce(total_sum)\r\n  File \"/home/tegn500/Documents/Work/Code/xarray/xarray/core/dataarray.py\", line 1605, in reduce\r\n    var = self.variable.reduce(func, dim, axis, keep_attrs, **kwargs)\r\n  File \"/home/tegn500/Documents/Work/Code/xarray/xarray/core/variable.py\", line 1365, in reduce\r\n    axis=axis, **kwargs)\r\nTypeError: total_sum() got an unexpected keyword argument 'axis'\r\n```\r\n\r\nThis contradicts what the docstring of `.reduce()` says:\r\n```\r\naxis: int or sequence of int, optional\r\n    Axis(es) over which to repeatedly apply func. Only one of the \u2018dim\u2019 and \u2018axis\u2019 \r\n    arguments can be supplied. If neither are supplied, then the reduction is \r\n    calculated over the flattened array (by calling f(x) without an axis argument).\r\n```\r\n\r\nThe problem is that in `variable.py` an `axis=None` kwarg is always passed to func, even if no axis argument is given by the user in `reduce`.  ", "{\"url\": \"https://api.github.com/repos/pydata/xarray/issues/2768/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", null, "completed", 13221727, "issue"]], "truncated": false, "filtered_table_rows_count": 1, "expanded_columns": [], "expandable_columns": [[{"column": "repo", "other_table": "repos", "other_column": "id"}, "name"], [{"column": "milestone", "other_table": "milestones", "other_column": "id"}, "title"], [{"column": "assignee", "other_table": "users", "other_column": "id"}, "login"], [{"column": "user", "other_table": "users", "other_column": "id"}, "login"]], "columns": ["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"], "primary_keys": ["id"], "units": {}, "query": {"sql": "select 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 from issues where date(\"closed_at\") = :p0 and \"state_reason\" = :p1 and \"user\" = :p2 order by updated_at desc limit 101", "params": {"p0": "2019-02-19", "p1": "completed", "p2": "35968931"}}, "facet_results": {"state": {"name": "state", "type": "column", "hideable": false, "toggle_url": "/github/issues.json?closed_at__date=2019-02-19&state_reason=completed&user=35968931", "results": [{"value": "closed", "label": "closed", "count": 1, "toggle_url": "http://xarray-datasette.fly.dev/github/issues.json?closed_at__date=2019-02-19&state_reason=completed&user=35968931&state=closed", "selected": false}], "truncated": false}, "repo": {"name": "repo", "type": "column", "hideable": false, "toggle_url": "/github/issues.json?closed_at__date=2019-02-19&state_reason=completed&user=35968931", "results": [{"value": 13221727, "label": "xarray", "count": 1, "toggle_url": "http://xarray-datasette.fly.dev/github/issues.json?closed_at__date=2019-02-19&state_reason=completed&user=35968931&repo=13221727", "selected": false}], "truncated": false}, "type": {"name": "type", "type": "column", "hideable": false, "toggle_url": "/github/issues.json?closed_at__date=2019-02-19&state_reason=completed&user=35968931", "results": [{"value": "issue", "label": "issue", "count": 1, "toggle_url": "http://xarray-datasette.fly.dev/github/issues.json?closed_at__date=2019-02-19&state_reason=completed&user=35968931&type=issue", "selected": false}], "truncated": false}}, "suggested_facets": [{"name": "created_at", "type": "date", "toggle_url": "http://xarray-datasette.fly.dev/github/issues.json?closed_at__date=2019-02-19&state_reason=completed&user=35968931&_facet_date=created_at"}, {"name": "updated_at", "type": "date", "toggle_url": "http://xarray-datasette.fly.dev/github/issues.json?closed_at__date=2019-02-19&state_reason=completed&user=35968931&_facet_date=updated_at"}, {"name": "closed_at", "type": "date", "toggle_url": "http://xarray-datasette.fly.dev/github/issues.json?closed_at__date=2019-02-19&state_reason=completed&user=35968931&_facet_date=closed_at"}], "next": null, "next_url": null, "private": false, "allow_execute_sql": true, "query_ms": 27.055137790739536}