Skip to content

Commit

Permalink
Remove Optional from tags
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Dec 9, 2021
1 parent 465c7be commit 1e78e24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tribler-common/tribler_common/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_extract_tags():


def test_extract_plain_fts_query_text():
assert not extract_plain_fts_query_text(None, None)
assert not extract_plain_fts_query_text(None, set())
assert not extract_plain_fts_query_text('', set())
assert extract_plain_fts_query_text('query', set()) == 'query'
assert extract_plain_fts_query_text('query', {'tag'}) == 'query'
Expand Down
4 changes: 2 additions & 2 deletions src/tribler-common/tribler_common/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def extract_tags(text: Optional[str]) -> Set[str]:
return {tag[1:-1] for tag in extract_tags_re.findall(text)}


def extract_plain_fts_query_text(query: Optional[str], tags: Optional[Set[str]]) -> str:
if query is None or tags is None:
def extract_plain_fts_query_text(query: Optional[str], tags: Set[str]) -> str:
if query is None:
return ''

for tag in tags:
Expand Down

0 comments on commit 1e78e24

Please sign in to comment.