mapnik-org/mapnik — Issue #316: Null handling missing in Filter parser?
Author: artemp
Created: 2011-10-11 07:48:16+00:00
State: open
Labels: Core_Library

Revised NULL handling was added in r693, but creating filters to match null does not yet work as I would expect:

{{{
>>> import mapnik
>>> mapnik.Filter("[val] = NULL")
Traceback (most recent call last):
File "", line 1, in
UserWarning: Failed to parse filter expression:
[val] = NULL
Parsing aborted at '='
>>> mapnik.Filter("[val] = null")
Traceback (most recent call last):
File "", line 1, in
UserWarning: Failed to parse filter expression:
[val] = null
Parsing aborted at '='
>>> mapnik.Filter("[val] is null")
Traceback (most recent call last):
File "", line 1, in
UserWarning: Failed to parse filter expression:
[val] is null
Parsing aborted at 'i'
}}}

Rather the only solution seems to be:

{{{
>>> mapnik.Filter("not [val] <> ''")

}}}