Skip to content

Commit

Permalink
Searching for an empty string now returns an empty list.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav committed Oct 16, 2024
1 parent 9b18de1 commit 915698b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ async def lookup(string: str,
will be returned, rather than filtering to concepts that are both PhenotypicFeature and Disease.
"""

# Do we have a search string at all?
if string.strip() == "":
return []

# First, we lowercase the query since all our indexes are case-insensitive.
string_lc = string.lower()

Expand Down Expand Up @@ -492,5 +496,5 @@ async def lookup(string: str,
provider.add_span_processor(processor)
trace.set_tracer_provider(provider)
FastAPIInstrumentor.instrument_app(app, tracer_provider=provider, excluded_urls=
"docs,openapi.json")
"docs,openapi.json")
HTTPXClientInstrumentor().instrument()

0 comments on commit 915698b

Please sign in to comment.