home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1189512813

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/6812#issuecomment-1189512813 https://api.github.com/repos/pydata/xarray/issues/6812 1189512813 IC_kwDOAMm_X85G5oZt 145117 2022-07-19T20:19:29Z 2022-07-19T20:19:29Z CONTRIBUTOR

I'm reading more in https://github.com/pydata/xarray/blob/2a5686c6fe855502523e495e43bd381d14191c7b/xarray/coding/variables.py and I'm confused about some logic:

https://github.com/pydata/xarray/blob/2a5686c6fe855502523e495e43bd381d14191c7b/xarray/coding/variables.py#L271-L272

pop_to does a pop operation - it removes the key/value pair. So line 1 above will remove add_offset from attrs if it exists. The second line then checks for "add_offset" in attrs which should always be False.

I think this is happening based on inspecting with the debugger.

Furthermore, the fix I implemented in this Pull Request which returns np.float64 fixes my bug, but only because this bug exists. My dataset has add_offset, so the lines I changed:

python if not has_offset: return np.float64

should not run, but do run because of this issue.

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