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/2533#issuecomment-436498217,https://api.github.com/repos/pydata/xarray/issues/2533,436498217,MDEyOklzc3VlQ29tbWVudDQzNjQ5ODIxNw==,1217238,2018-11-07T04:07:59Z,2018-11-07T04:07:59Z,MEMBER,"> Does adding fastpath to skip shape checking in array_wrap work? fastpath=True in both DataArray.array_wrap and Variable.array_wrap didn't seem to break any tests. I think it would be slightly better to stick with a separate method for xarray's fast-path. `__array_wrap__` is a special protocol used by NumPy, so there's always a (unlikely) risk that if we use different arguments in our version it could break in the future.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,376167325 https://github.com/pydata/xarray/pull/2533#issuecomment-435271342,https://api.github.com/repos/pydata/xarray/issues/2533,435271342,MDEyOklzc3VlQ29tbWVudDQzNTI3MTM0Mg==,1217238,2018-11-02T04:57:31Z,2018-11-02T04:57:31Z,MEMBER,"@lilyminium thanks for looking into this! I think the specific problem here is due to our use of the shortcut `_replace` method in `DataArray.__array_wrap__` (which is called by NumPy, e.g., inside np.insert): https://github.com/pydata/xarray/blob/6d55f99905d664ef73cb708cfe8c52c2c651e8dc/xarray/core/dataarray.py#L193 I think the clean way to fix this would be to add error checking to `DataArray.__array_wrap__`. But we currently use this method inside `DataArray._unary_op` (and maybe elsewhere?), which is called every time you do unwary math with an xarray object (e.g., `- `). We’ll want to update these uses to use a method that uses the same shortcut to avoid redundant metadata checks.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,376167325