@@ -5269,7 +5269,7 @@ def _arith_op(left, right):
52695269 with np .errstate (all = "ignore" ):
52705270 res_values = _arith_op (this .values , other .values )
52715271 new_data = dispatch_fill_zeros (func , this .values , other .values , res_values )
5272- return this ._construct_result (other , new_data , _arith_op )
5272+ return this ._construct_result (new_data )
52735273
52745274 def _combine_match_index (self , other , func , level = None ):
52755275 left , right = self .align (other , join = "outer" , axis = 0 , level = level , copy = False )
@@ -5282,44 +5282,31 @@ def _combine_match_index(self, other, func, level=None):
52825282 # fastpath --> operate directly on values
52835283 with np .errstate (all = "ignore" ):
52845284 new_data = func (left .values .T , right .values ).T
5285- return left ._construct_result (other , new_data , func )
5285+ return left ._construct_result (new_data )
52865286
52875287 def _combine_match_columns (self , other : Series , func , level = None ):
52885288 left , right = self .align (other , join = "outer" , axis = 1 , level = level , copy = False )
52895289 # at this point we have `left.columns.equals(right.index)`
52905290 new_data = ops .dispatch_to_series (left , right , func , axis = "columns" )
5291- return left ._construct_result (right , new_data , func )
5291+ return left ._construct_result (new_data )
52925292
5293- def _combine_const (self , other , func ):
5294- # scalar other or np.ndim(other) == 0
5295- new_data = ops .dispatch_to_series (self , other , func )
5296- return self ._construct_result (other , new_data , func )
5297-
5298- def _construct_result (self , other , result , func ):
5293+ def _construct_result (self , result ) -> "DataFrame" :
52995294 """
53005295 Wrap the result of an arithmetic, comparison, or logical operation.
53015296
53025297 Parameters
53035298 ----------
5304- other : object
53055299 result : DataFrame
5306- func : binary operator
53075300
53085301 Returns
53095302 -------
53105303 DataFrame
5311-
5312- Notes
5313- -----
5314- `func` is included for compat with SparseDataFrame signature, is not
5315- needed here.
53165304 """
53175305 out = self ._constructor (result , index = self .index , copy = False )
53185306 # Pin columns instead of passing to constructor for compat with
53195307 # non-unique columns case
53205308 out .columns = self .columns
53215309 return out
5322- # TODO: finalize? we do for SparseDataFrame
53235310
53245311 def combine (self , other , func , fill_value = None , overwrite = True ):
53255312 """
0 commit comments