File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -10481,10 +10481,11 @@ def apply(
10481
10481
f"{ result_type = } only implemented for the default engine"
10482
10482
)
10483
10483
10484
- agg_axis = self ._get_agg_axis (axis )
10484
+ agg_axis = self ._get_agg_axis (self . _get_axis_number ( axis ) )
10485
10485
10486
10486
# one axis is empty
10487
10487
if not all (self .shape ):
10488
+ func = cast (Callable , func )
10488
10489
try :
10489
10490
if axis == 0 :
10490
10491
r = func (Series ([], dtype = np .float64 ), * args , ** kwargs )
@@ -10506,13 +10507,13 @@ def apply(
10506
10507
return self ._constructor_sliced (r , index = agg_axis )
10507
10508
return self .copy ()
10508
10509
10509
- data = self
10510
+ data : DataFrame | np . ndarray = self
10510
10511
if raw :
10511
10512
# This will upcast the whole DataFrame to the same type,
10512
10513
# and likely result in an object 2D array.
10513
10514
# We should probably pass a list of 1D arrays instead, at
10514
10515
# lest for ``axis=0``
10515
- data = data .values
10516
+ data = self .values
10516
10517
result = engine .__pandas_udf__ .apply (
10517
10518
data = data ,
10518
10519
func = func ,
You can’t perform that action at this time.
0 commit comments