{"database": "github", "table": "issue_comments", "is_view": false, "human_description_en": "where author_association = \"MEMBER\", issue = 59720901 and user = 1217238 sorted by updated_at descending", "rows": [["https://github.com/pydata/xarray/issues/358#issuecomment-291611335", "https://api.github.com/repos/pydata/xarray/issues/358", 291611335, "MDEyOklzc3VlQ29tbWVudDI5MTYxMTMzNQ==", 1217238, "2017-04-04T19:46:39Z", "2017-04-04T20:37:12Z", "MEMBER", "Yes, looks pretty good. It would be nice to consolidate this with xarray's current logic for getting virtual datetime variables (they should probably delegate to the accessor):\r\nhttps://github.com/pydata/xarray/blob/94790388c273c0c1ce2c203940a706d331deb14f/xarray/core/dataset.py#L41\r\n\r\n> I wonder, is there any way to register such an accessor with DataArrays that have a specific dtype? \r\n\r\nThe simplest option is to raise `AttributeError` or `TypeError` in the constructor, e.g., \r\n```python\r\n@xarray.register_dataarray_accessor('float_only')\r\nclass FloatOnlyAccessor(object):\r\n  def __init__(self, parent):\r\n    if parent.dtype.kind != 'f':\r\n      raise TypeError('wrong dtype')\r\n    self.parent = parent\r\n```\r\n\r\n```\r\n>>> xarray.DataArray(1.5).float_only\r\n<__main__.FloatOnlyAccessor at 0x8d51350>\r\n>>> xarray.DataArray(1).float_only\r\nTypeError: wrong dtype\r\n```", "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", null, 59720901], ["https://github.com/pydata/xarray/issues/358#issuecomment-291232960", "https://api.github.com/repos/pydata/xarray/issues/358", 291232960, "MDEyOklzc3VlQ29tbWVudDI5MTIzMjk2MA==", 1217238, "2017-04-03T18:34:47Z", "2017-04-03T18:34:47Z", "MEMBER", "Yes, I think this would be quite straightforward. I think the easiest way to do it would simply be to reuse xarray's accessor interface (i.e., `register_dataarray_accessor`) and then implement all the desired methods/properties.", "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", null, 59720901]], "truncated": false, "filtered_table_rows_count": 2, "expanded_columns": [], "expandable_columns": [[{"column": "issue", "other_table": "issues", "other_column": "id"}, "title"], [{"column": "user", "other_table": "users", "other_column": "id"}, "login"]], "columns": ["html_url", "issue_url", "id", "node_id", "user", "created_at", "updated_at", "author_association", "body", "reactions", "performed_via_github_app", "issue"], "primary_keys": ["id"], "units": {}, "query": {"sql": "select html_url, issue_url, id, node_id, user, created_at, updated_at, author_association, body, reactions, performed_via_github_app, issue from issue_comments where \"author_association\" = :p0 and \"issue\" = :p1 and \"user\" = :p2 order by updated_at desc limit 101", "params": {"p0": "MEMBER", "p1": "59720901", "p2": "1217238"}}, "facet_results": {"author_association": {"name": "author_association", "type": "column", "hideable": false, "toggle_url": "/github/issue_comments.json?author_association=MEMBER&issue=59720901&user=1217238", "results": [{"value": "MEMBER", "label": "MEMBER", "count": 2, "toggle_url": "http://xarray-datasette.fly.dev/github/issue_comments.json?issue=59720901&user=1217238", "selected": true}], "truncated": false}, "user": {"name": "user", "type": "column", "hideable": false, "toggle_url": "/github/issue_comments.json?author_association=MEMBER&issue=59720901&user=1217238", "results": [{"value": 1217238, "label": "shoyer", "count": 2, "toggle_url": "http://xarray-datasette.fly.dev/github/issue_comments.json?author_association=MEMBER&issue=59720901", "selected": true}], "truncated": false}, "issue": {"name": "issue", "type": "column", "hideable": false, "toggle_url": "/github/issue_comments.json?author_association=MEMBER&issue=59720901&user=1217238", "results": [{"value": 59720901, "label": "add .dt and .str accessors to DataArray (like pandas.Series)", "count": 2, "toggle_url": "http://xarray-datasette.fly.dev/github/issue_comments.json?author_association=MEMBER&user=1217238", "selected": true}], "truncated": false}}, "suggested_facets": [], "next": null, "next_url": null, "private": false, "allow_execute_sql": true, "query_ms": 1905.5923160049133}