@@ -2735,6 +2735,20 @@ def copy(self, deep=True, mgr=None):
2735
2735
kind = self .kind , copy = deep ,
2736
2736
placement = self .mgr_locs )
2737
2737
2738
+ def make_block (self , values , placement = None ,
2739
+ ndim = None , fill_value = None , ** kwargs ):
2740
+ """
2741
+ Create a new block, with type inference propagate any values that are
2742
+ not specified
2743
+ """
2744
+ if fill_value is not None and isinstance (values , SparseArray ):
2745
+ values = SparseArray (values .to_dense (), fill_value = fill_value ,
2746
+ kind = values .kind , dtype = values .dtype )
2747
+
2748
+ return super (SparseBlock , self ).make_block (values , placement = placement ,
2749
+ ndim = ndim , fill_value = None ,
2750
+ ** kwargs )
2751
+
2738
2752
def make_block_same_class (self , values , placement , sparse_index = None ,
2739
2753
kind = None , dtype = None , fill_value = None ,
2740
2754
copy = False , fastpath = True , ** kwargs ):
@@ -2833,7 +2847,7 @@ def sparse_reindex(self, new_index):
2833
2847
2834
2848
2835
2849
def make_block (values , placement , klass = None , ndim = None , dtype = None ,
2836
- fastpath = False ):
2850
+ fastpath = False , ** kwargs ):
2837
2851
if klass is None :
2838
2852
dtype = dtype or values .dtype
2839
2853
vtype = dtype .type
0 commit comments