File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -343,15 +343,15 @@ def expand_function_from_string(df, str_func):
343343 module = importlib .import_module (module_name )
344344 filter_func = getattr (module , filter_name , None )
345345
346- if hasattr (filter_func , "__code__" ):
347- ninput = filter_func .__code__ .co_argcount
348- # Note: This works only with `struct` fields - not `array`
349- argnames = filter_func .__code__ .co_varnames [:ninput ]
350- else :
346+ if hasattr (filter_func , "func" ):
351347 # Assume decorated function (typically ZTF)
352348 ninput = filter_func .func .__code__ .co_argcount
353349 # Note: This works only with `struct` fields - not `array`
354350 argnames = filter_func .func .__code__ .co_varnames [:ninput ]
351+ else :
352+ ninput = filter_func .__code__ .co_argcount
353+ # Note: This works only with `struct` fields - not `array`
354+ argnames = filter_func .__code__ .co_varnames [:ninput ]
355355
356356 colnames = []
357357 for argname in argnames :
You can’t perform that action at this time.
0 commit comments