I created a function force_numeric_list
in my QGIS Expression "Function Editor" (see image below) to reuse it in other functions there, e.g. as shown below in the function get_min_from_attributes()
.
When simply calling the function
force_numeric_list(attrmap_filtered.values(), True)
I get the error:
'QgsPyExpressionFunction' object is not callable.
I've learned here, that this is due to the special circumstance under which the Expression functions are called, needing to have the arguments of feature and parent (however simply passing them with force_numeric_list(..., feature, parent)
doesn't work either.
I can however evaluate the function like this
QgsExpression('force_numeric_list(attrmap_filtered.values(), True)').evaluate()
but this returns NULL
, which doesn't help (since I need the return value of the function).
How can I call QgsPyExpressionFunctions
from within QgsPyExpressionFunctions
and get their return values?