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(
1048110481 f"{ result_type = } only implemented for the default engine"
1048210482 )
1048310483
10484- agg_axis = self ._get_agg_axis (axis )
10484+ agg_axis = self ._get_agg_axis (self . _get_axis_number ( axis ) )
1048510485
1048610486 # one axis is empty
1048710487 if not all (self .shape ):
10488+ func = cast (Callable , func )
1048810489 try :
1048910490 if axis == 0 :
1049010491 r = func (Series ([], dtype = np .float64 ), * args , ** kwargs )
@@ -10506,13 +10507,13 @@ def apply(
1050610507 return self ._constructor_sliced (r , index = agg_axis )
1050710508 return self .copy ()
1050810509
10509- data = self
10510+ data : DataFrame | np . ndarray = self
1051010511 if raw :
1051110512 # This will upcast the whole DataFrame to the same type,
1051210513 # and likely result in an object 2D array.
1051310514 # We should probably pass a list of 1D arrays instead, at
1051410515 # lest for ``axis=0``
10515- data = data .values
10516+ data = self .values
1051610517 result = engine .__pandas_udf__ .apply (
1051710518 data = data ,
1051810519 func = func ,
You can’t perform that action at this time.
0 commit comments