Skip to content

Commit

Permalink
use more forgiving ClickHouse datetime function
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Dec 10, 2021
1 parent 7331c58 commit a3d87e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ee/clickhouse/models/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ def prop_filter_json_extract(
elif operator == "is_after":
prop_value_param_key = "v{}_{}".format(prepend, idx)
return (
f"AND toDateTimeOrNull({property_expr}) > %({prop_value_param_key})s",
f"AND parseDateTimeBestEffortOrNull({property_expr}) > %({prop_value_param_key})s",
{"k{}_{}".format(prepend, idx): prop.key, prop_value_param_key: prop.value},
)
elif operator == "is_before":
prop_value_param_key = "v{}_{}".format(prepend, idx)
return (
f"AND toDateTimeOrNull({property_expr}) < %({prop_value_param_key})s",
f"AND parseDateTimeBestEffortOrNull({property_expr}) < %({prop_value_param_key})s",
{"k{}_{}".format(prepend, idx): prop.key, prop_value_param_key: prop.value},
)
elif operator == "gt":
Expand Down

0 comments on commit a3d87e4

Please sign in to comment.