Skip to content

Commit

Permalink
Update query/parsers.py
Browse files Browse the repository at this point in the history
Minor updates and fixes in comments and documentation
  • Loading branch information
rahul4732saini committed Jul 11, 2024
1 parent e5bda65 commit 7c23574
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fise/query/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _get_from_keyword_index(subquery: list[str]) -> int:
if kw.lower() == "from":
return i

raise QueryParseError("Cannot find 'FROM' keyword in the query.")
raise QueryParseError("Cannot find the 'FROM' keyword in the query.")


def _get_condition_handler(
Expand All @@ -58,7 +58,7 @@ def _get_condition_handler(
"""

# Returns a lambda function returning `True` by default to include all the records
# during processing in no conditions are explicitly defined in the specified subquery.
# during processing in no conditions are explicitly defined in the query.
if not subquery:
return lambda _: True

Expand Down Expand Up @@ -146,10 +146,10 @@ def _parse_directory(self) -> tuple[Path, int]:

def _parse_remove_query(self) -> DeleteQuery:
"""
Parses the file delete query.
Parses the delete query.
"""

if self._from_index != 0:
if self._from_index:
raise QueryParseError("Invalid query syntax.")

path, index = self._parse_directory()
Expand All @@ -165,7 +165,7 @@ def _parse_remove_query(self) -> DeleteQuery:

def _parse_search_query(self) -> SearchQuery:
"""
Parses the file search query.
Parses the search query.
"""

fields, columns = self._parse_fields(self._query[: self._from_index])
Expand All @@ -182,7 +182,7 @@ def _parse_search_query(self) -> SearchQuery:

def parse_query(self) -> SearchQuery | DeleteQuery:
"""
Parses the file search/delete query.
Parses the search/delete query.
"""
return (
self._parse_search_query()
Expand Down

0 comments on commit 7c23574

Please sign in to comment.