Skip to content

Commit

Permalink
Update comments and documentation in conditions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul4732saini committed Nov 3, 2024
1 parent 19c70c4 commit bd40e4d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fise/query/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ def _parse_comparison_operand(self, operand: str) -> Any:
if constants.STRING_PATTERN.match(operand):
# Strips the leading and trailing quotes in the string.
operand = operand[1:-1]
date_time: datetime | None = self._parse_datetime(operand)

return date_time or operand
# Returns a datetime object if it matches the ISO-8601
# date & time pattern. Otherwise, returns a string object.
return self._parse_datetime(operand) or operand

elif constants.FLOAT_PATTERN.match(operand):
return float(operand)
Expand All @@ -87,8 +88,8 @@ def _parse_comparison_operand(self, operand: str) -> Any:
elif operand.lower() == "none":
return None

# If none of the above conditions are matched, the operand is
# assumed to be a query field and returned as `BaseField` object.
# If none of the above conditions match, the operand
# is assumed to be a query field and parse accordingly.
return parse_field(operand, self._entity)

def _parse_collective_operand(self, operand: str, operator: str) -> Any | list[str]:
Expand Down

0 comments on commit bd40e4d

Please sign in to comment.