Skip to content

Commit cfd0dda

Browse files
authored
fix(interface): handle epoch time in _filter_to_restriction
1 parent 963e321 commit cfd0dda

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pharus/interface.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,12 @@ def _filter_to_restriction(attribute_filter: dict, attribute_type: str) -> str:
517517
operation = " IS " if attribute_filter["operation"] == "=" else " IS NOT "
518518
else:
519519
operation = attribute_filter["operation"]
520+
521+
if (
522+
re.match(r"^datetime.*$", attribute_type)
523+
or re.match(r"timestamp", attribute_type)
524+
) and str(attribute_filter["value"]).isnumeric():
525+
attribute_filter["value"] = f"FROM_UNIXTIME({attribute_filter['value']})"
520526

521527
if (
522528
isinstance(attribute_filter["value"], str)

0 commit comments

Comments
 (0)