home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 864465814

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/pull/5365#issuecomment-864465814 https://api.github.com/repos/pydata/xarray/issues/5365 864465814 MDEyOklzc3VlQ29tbWVudDg2NDQ2NTgxNA== 5635139 2021-06-19T21:26:50Z 2021-06-19T21:26:50Z MEMBER

It's true that Variable doesn't have it. But a Variable can't use that code path since we check getattr(array_large, "coords", False).

Ah, then we can tell mypy this, I think just by switching to isinstance(array_large, Variable) (and in case it wasn't clear, it's also OK to skip some of these or leave them to another PR. They can be useful checks for things we miss, but we shouldn't be beholden to the linting)

The check can't be that simple though because DataArrays doesn't always include coords and then it doesn't make sense to use reindex_like. I suppose adding a hasattr(array_large, "reindex_like") is an option, but it feels redundant to me.

getattr(array_large, "coords", False) will always pass for DataArrays — even if there are no coords, it's checking whether there's a coords method on the class — which in the case of a DataArray with no coords, would return empty (but still return). Or am I misunderstanding?

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