Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add handlesnull parameter to @qgsfunction
Up to date it was not possible to create a function that handles NULL values with the @qgsfunction decorator. As soon as any parameter was NULL, the return value would also be NULL. Example of a function that returns a value now with a NULL paramter and would have returned NULL before ``` @qgsfunction(args=-1, group='Custom', handlesnull=True) def mean_value(vals, feature, parent): valid_vals = [val for val in vals if val != NULL] return sum(valid_vals)/len(valid_vals) ``` [FEATURE]
- Loading branch information
Showing
1 changed file
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters