Skip to content

Commit

Permalink
Merge pull request #78 from jokiefer/bugfix/qualified-attribute
Browse files Browse the repository at this point in the history
add support for qualified named attribute in ecql
  • Loading branch information
constantinius authored Nov 15, 2023
2 parents 9a2d0ea + 468cdf2 commit a08c5a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pygeofilter/parsers/ecql/grammar.lark
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@

attribute: NAME
| DOUBLE_QUOTED
| QUALIFIED_NAME

?literal: number
| BOOLEAN
Expand All @@ -113,6 +114,8 @@ BOOLEAN: ( "TRUE" | "FALSE" )
DOUBLE_QUOTED: "\"" /.*?/ "\""
SINGLE_QUOTED: "'" /.*?/ "'"

QUALIFIED_NAME: NAME ":" NAME

%import .wkt.ewkt_geometry
%import .iso8601.DATETIME
%import .iso8601.DURATION
Expand Down
8 changes: 8 additions & 0 deletions tests/parsers/ecql/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
from pygeofilter.parsers.ecql import parse


def test_namespace_attribute_eq_literal():
result = parse("ns:attr = 'A'")
assert result == ast.Equal(
ast.Attribute("ns:attr"),
"A",
)


def test_attribute_eq_literal():
result = parse("attr = 'A'")
assert result == ast.Equal(
Expand Down

0 comments on commit a08c5a5

Please sign in to comment.