home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 242800119

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/987#issuecomment-242800119 https://api.github.com/repos/pydata/xarray/issues/987 242800119 MDEyOklzc3VlQ29tbWVudDI0MjgwMDExOQ== 1217238 2016-08-26T17:34:37Z 2016-08-26T17:34:37Z MEMBER

I wonder if it is reasonable to return a scalar when there is neither coords nor attrs associated with the return value, or it would be too much ad-hoc thing. For example, in the original example the return value was <xarray.DataArray ()>, which does not have any useful information.

This is a bad path to go down :). Now your code might suddenly break when you add a metadata field!

In principle, we could pick some subset of operations for which to always do this and others for which to never do this (e.g., aggregating out all dimensions, but not indexing out all dimensions), but I think this inconsistency would be even more surprising. It's pretty easy to see how this could lead to bugs, too. At least now you know you always need to type .values or .item()!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  173494017
Powered by Datasette · Queries took 14.773ms · About: xarray-datasette