File tree Expand file tree Collapse file tree 1 file changed +13
-25
lines changed Expand file tree Collapse file tree 1 file changed +13
-25
lines changed Original file line number Diff line number Diff line change @@ -1148,31 +1148,19 @@ def wrapper(*args, **kwargs):
1148
1148
return wrapper
1149
1149
1150
1150
if engine == "numba" :
1151
- try :
1152
- import numba
1153
-
1154
- if not hasattr (numba .jit , "__pandas_udf__" ):
1155
- numba .jit .__pandas_udf__ = NumbaExecutionEngine
1156
- result = numba .jit .__pandas_udf__ .apply (
1157
- self .values ,
1158
- self .func ,
1159
- self .args ,
1160
- self .kwargs ,
1161
- engine_kwargs ,
1162
- self .axis ,
1163
- )
1164
- else :
1165
- raise ImportError
1166
- except ImportError :
1167
- engine_obj = NumbaExecutionEngine ()
1168
- result = engine_obj .apply (
1169
- self .values ,
1170
- self .func ,
1171
- self .args ,
1172
- self .kwargs ,
1173
- engine_kwargs ,
1174
- self .axis ,
1175
- )
1151
+ numba = import_optional_dependency ("numba" )
1152
+
1153
+ if not hasattr (numba .jit , "__pandas_udf__" ):
1154
+ numba .jit .__pandas_udf__ = NumbaExecutionEngine
1155
+
1156
+ result = numba .jit .__pandas_udf__ .apply (
1157
+ self .values ,
1158
+ self .func ,
1159
+ self .args ,
1160
+ self .kwargs ,
1161
+ engine_kwargs ,
1162
+ self .axis ,
1163
+ )
1176
1164
else :
1177
1165
result = np .apply_along_axis (
1178
1166
wrap_function (self .func ),
You can’t perform that action at this time.
0 commit comments