Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pygeofilter/parsers/cql2_json/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def walk_cql_json(node: JsonType): # noqa: C901
float,
int,
bool,
date,
datetime,
values.Geometry,
values.Interval,
Expand Down
16 changes: 15 additions & 1 deletion tests/parsers/cql2_json/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# ------------------------------------------------------------------------------

import json
from datetime import datetime, timedelta
from datetime import date, datetime, timedelta

from dateparser.timezone_parser import StaticTzInfo
from pygeoif import geometry
Expand Down Expand Up @@ -164,6 +164,20 @@ def test_attribute_before():
datetime(2000, 1, 1, 0, 0, 1, tzinfo=StaticTzInfo("Z", timedelta(0))),
)

result = parse(
{
"op": "t_before",
"args": [
{"property": "attr"},
{"date": "2000-01-01"},
],
}
)
assert result == ast.TimeBefore(
ast.Attribute("attr"),
date(2000, 1, 1),
)


def test_attribute_after_dt_dt():
result = parse(
Expand Down