Skip to content

Commit

Permalink
linter updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdawson1982 committed Feb 26, 2024
1 parent e34a241 commit 35075f8
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions home/service/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ def _highlight_results(self):
return highlighted_results

else:
pattern = f"({re.escape(query)})"
pattern = f"({re.escape(query)})"
for result in highlighted_results.page_results:
result.description = re.sub(
Expand All @@ -207,6 +206,7 @@ def _highlight_results(self):
result.description,
flags=re.IGNORECASE,
)

return highlighted_results

def _get_match_reason_display_names(self):
Expand All @@ -219,19 +219,3 @@ def _get_match_reason_display_names(self):
"fieldPaths": "Column name",
"fieldDescriptions": "Column description",
}

@staticmethod
def _query_builder(query: str, custom_properties: dict[str, list[str | None]]):
custom_property_query: str = "/q customProperties: "
custom_property_strings: list[str] = []

for _, value in custom_properties.items():
if value:
custom_property_strings.append(" OR ".join(value))

if query != "":
custom_property_strings.append(query)

final_query = " AND ".join(custom_property_strings)

return f"{custom_property_query} {final_query}" if final_query else "*"

0 comments on commit 35075f8

Please sign in to comment.