File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -3832,7 +3832,12 @@ def unstack(
38323832
38333833 result = self .copy (deep = False )
38343834 for dim in dims :
3835- if sparse :
3835+ # FIXME: remove
3836+ import sparse as sparse_
3837+
3838+ if sparse or any (
3839+ isinstance (v .data , sparse_ .COO ) for v in self .variables .values ()
3840+ ):
38363841 result = result ._unstack_once (dim , fill_value , sparse )
38373842 else :
38383843 result = result ._unstack_once_fast (dim , fill_value , sparse )
Original file line number Diff line number Diff line change @@ -1597,8 +1597,6 @@ def _unstack_once_fast(
15971597 new_shape = list (reordered .shape [: len (other_dims )]) + new_dim_sizes
15981598 new_dims = reordered .dims [: len (other_dims )] + new_dim_names
15991599
1600- # missing_values = np.prod(new_shape) > np.prod(self.shape)
1601-
16021600 if fill_value is dtypes .NA :
16031601 fill_value = dtypes .get_fill_value (self .dtype )
16041602
You can’t perform that action at this time.
0 commit comments