Skip to content

Expr.reduce() incorectly cancels out the IN operator. #111

@pacesm

Description

@pacesm

Tested with version 0.4.1 in Python 3.12.12

Taking an example from from the CQL2 spec https://docs.ogc.org/is/21-065r2/21-065r2.html#advanced-comparison-operators, the IN predicate is completely eliminated by the Expr.reduce() operation:

>>> import cql2
>>> cql2.Expr("cityName IN ('Toronto','Frankfurt','Tokyo','New York')").reduce().to_text()
'false'

It looks like the reduction incorrectly treats the property identifier as a string literal (like 'cityName' IN ('Toronto','Frankfurt','Tokyo','New York')) and evaluates the whole predicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions