in connectors/sources/github.py [0:0]
def _filter_rule_query(self, repo, query, query_type):
"""
Filters a query based on the query type.
Args:
repo (str): Query repo name.
query (str): The input query.
query_type (str): The type of query ("pr" or "issue").
Returns:
tuple: A tuple containing a boolean value indicating whether the query should be included or excluded and the modified query.
"""
if query_type == ObjectType.PR.value:
if "is:issue" in query:
return False, query
elif "is:pr" in query:
return True, f"repo:{repo} {query}"
return True, f"repo:{repo} is:pr {query}"
elif query_type == ObjectType.ISSUE.value.lower():
if "is:pr" in query:
return False, query
elif "is:issue" in query:
return True, f"repo:{repo} {query}"
return True, f"repo:{repo} is:issue {query}"
else:
return False, query