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/4746#issuecomment-753426440,https://api.github.com/repos/pydata/xarray/issues/4746,753426440,MDEyOklzc3VlQ29tbWVudDc1MzQyNjQ0MA==,3460034,2021-01-02T03:49:28Z,2021-01-02T03:49:28Z,CONTRIBUTOR,"I think it is best to check against the global `pint.Quantity` (`isinstance(self.data, pint.Quantity)`). This should work to check for a Quantity from any unit registry (rather than the other methods which are registry-specific since a class builder is used).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,777153550 https://github.com/pydata/xarray/pull/4746#issuecomment-753423841,https://api.github.com/repos/pydata/xarray/issues/4746,753423841,MDEyOklzc3VlQ29tbWVudDc1MzQyMzg0MQ==,3460034,2021-01-02T03:15:56Z,2021-01-02T03:15:56Z,CONTRIBUTOR,"@max-sixty That error seems to be arising because `data` is an `numpy.ndarray` and `reordered` is an `xarray.Variable` with a `pint.Quantity` inside, hence trying to assign a unit-aware array to an `ndarray` causes the units to be stripped. Perhaps relevant to the discussion is this Pint issue https://github.com/hgrecco/pint/issues/882 where it was tentatively decided that Pint's wrapped implementation of `np.full_like` would base its units off of `fill_value` alone, so as it is now, I think `_unstack_once` would need to create a `Quantity`-wrapped `nan` in the units of `self.data` for Pint to create an `Quantity` filled with `nan`s (if I'm interpreting the implementation here correctly and that is what is needed). This seems like something where units-on-the-dtype would be useful, but alas, things aren't there yet!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,777153550