File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -3832,7 +3832,12 @@ def unstack(
3832
3832
3833
3833
result = self .copy (deep = False )
3834
3834
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
+ ):
3836
3841
result = result ._unstack_once (dim , fill_value , sparse )
3837
3842
else :
3838
3843
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(
1597
1597
new_shape = list (reordered .shape [: len (other_dims )]) + new_dim_sizes
1598
1598
new_dims = reordered .dims [: len (other_dims )] + new_dim_names
1599
1599
1600
- # missing_values = np.prod(new_shape) > np.prod(self.shape)
1601
-
1602
1600
if fill_value is dtypes .NA :
1603
1601
fill_value = dtypes .get_fill_value (self .dtype )
1604
1602
You can’t perform that action at this time.
0 commit comments