Skip to content

Commit 9ab80e6

Browse files
Minor code fixes in query/__init__.py
1 parent d05530c commit 9ab80e6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

fise/query/__init__.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ def handle(self) -> pd.DataFrame | None:
8282
tools.export_to_sql(data, initials.export.target)
8383

8484
def _handle_file_query(self, initials: QueryInitials) -> pd.DataFrame | None:
85-
"""
86-
Parses and handles the specified file search/delete query.
87-
"""
85+
"""Parses and handles the specified file search or delete query"""
8886

8987
parser = FileQueryParser(self._query[self._ctr:], initials.operation.operation)
9088
query: SearchQuery | DeleteQuery = parser.parse_query()
@@ -97,17 +95,15 @@ def _handle_file_query(self, initials: QueryInitials) -> pd.DataFrame | None:
9795
operator.remove_files(query.condition, initials.operation.skip_err)
9896

9997
def _handle_data_query(self, initials: QueryInitials) -> pd.DataFrame:
100-
"""
101-
Parses and handles the specified data search query.
102-
"""
98+
"""Parses and handles the specified data search query"""
10399

104100
if (
105101
initials.export
106102
and initials.operation.filemode == "bytes"
107103
and initials.export.type_ == "database"
108104
):
109105
raise QueryParseError(
110-
"Exporting binary data to SQL databases is currently unsupported."
106+
"Exporting binary data to SQL databases is currently unsupported"
111107
)
112108

113109
parser = FileDataQueryParser(self._query[self._ctr:])
@@ -260,7 +256,9 @@ def _parse_operation(self) -> OperationData:
260256
)
261257

262258
if operation not in constants.OPERATION_ALIASES:
263-
raise QueryParseError(f"Invalid operation specified: {operation!r}")
259+
raise QueryParseError(
260+
f"Invalid operation {operation!r} specified in the query"
261+
)
264262

265263
# Verifying operation parameters syntax.
266264
if not self._operation_params_pattern.match(oparams):

0 commit comments

Comments
 (0)