File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -3849,6 +3849,18 @@ def unstack(
3849
3849
or sparse
3850
3850
# numpy full_like only added `shape` in 1.17
3851
3851
or LooseVersion (np .__version__ ) < LooseVersion ("1.17" )
3852
+ # Until https://github.com/pydata/xarray/pull/4751 is resolved,
3853
+ # we check explicitly whether it's a numpy array. Once that is
3854
+ # resolved, explicitly exclude pint arrays.
3855
+ # # pint doesn't implement `np.full_like` in a way that's
3856
+ # # currently compatible.
3857
+ # # https://github.com/pydata/xarray/pull/4746#issuecomment-753425173
3858
+ # # or any(
3859
+ # # isinstance(v.data, pint_array_type) for v in self.variables.values()
3860
+ # # )
3861
+ or any (
3862
+ not isinstance (v .data , np .array ) for v in self .variables .values ()
3863
+ )
3852
3864
):
3853
3865
result = result ._unstack_full_reindex (dim , fill_value , sparse )
3854
3866
else :
You can’t perform that action at this time.
0 commit comments