artemp/tickets2issues — Issue #402: Null handling missing in Filter parser?
Author: artemp
Created: 2011-10-11 15:15:05+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] <> ''")

}}}