Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding scope default #304

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions beacon/db/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,11 @@ def apply_ontology_filter(query: dict, filter: OntologyFilter, collection: str,
if synonym_id is not None:
filter.id=synonym_id

try:
scope = filter.scope
except Exception:

scope = filter.scope
if scope is None:
scope = collection[0:-1]

is_filter_id_required = True
# Search similar
if filter.similarity != Similarity.EXACT:
Expand Down Expand Up @@ -631,9 +632,8 @@ def format_operator(operator: Operator) -> str:

def apply_alphanumeric_filter(query: dict, filter: AlphanumericFilter, collection: str) -> dict:
#LOG.debug(filter.value)
try:
scope = filter.scope
except Exception:
scope = filter.scope
if scope is None:
scope = collection[0:-1]
formatted_value = format_value(filter.value)
formatted_operator = format_operator(filter.operator)
Expand Down Expand Up @@ -793,9 +793,8 @@ def apply_alphanumeric_filter(query: dict, filter: AlphanumericFilter, collectio
def apply_custom_filter(query: dict, filter: CustomFilter, collection:str) -> dict:
#LOG.debug(query)

try:
scope = filter.scope
except Exception:
scope = filter.scope
if scope is None:
scope = collection[0:-1]
value_splitted = filter.id.split(':')
if value_splitted[0] in conf.alphanumeric_terms:
Expand Down
Loading