Skip to content

Commit

Permalink
Fixed typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fbanados committed Nov 25, 2024
1 parent 8708113 commit f4515f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/morphodict/search/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def search(
"""

search_query = Query(query)

search_results = SearchResults(
auto=search_query.auto,
verbose=search_query.verbose,
Expand All @@ -49,7 +50,7 @@ def search(
espt_search.convert_search_query_to_espt()

if settings.MORPHODICT_ENABLE_CVD:
cvd_search_type = first_non_none_value(
cvd_search_type: CvdSearchType = first_non_none_value(
search_query.cvd, default=CvdSearchType.DEFAULT
)

Expand Down
2 changes: 1 addition & 1 deletion src/morphodict/search/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
T = TypeVar("T")


def first_non_none_value(*l: T, default: Optional[T] = None) -> T:
def first_non_none_value(*l: Optional[T], default: Optional[T] = None) -> T:
"""
Return the first item in the iterable that is not None.
Expand Down
4 changes: 2 additions & 2 deletions src/morphodict/search_quality/run_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def gen_run_sample(

combined_results[query] = {
"time_taken_seconds": time_taken,
"results": results,
"results": results.serialized_presentation_results(),
}

count = count_results(results)
count = count_results(results.serialized_presentation_results())
yield f"{count:,} results for ‘{query}’ in {time_taken:0.3}s"

# "wt" because although gzip is a binary file format, json.dump is going to
Expand Down

0 comments on commit f4515f0

Please sign in to comment.