def _build_query(*queries: Union[QueryExpression, Dict, bool]) -> QueryExpression: if len(queries) == 0: return QueryExpression() for query in queries: if isinstance(query, bool): raise TypeError("cannot build query using booleans") queries = cast(Tuple[Union[QueryExpression, Dict], ...], queries) if len(queries) == 1: return QueryExpression(queries[0]) return and_(*queries)
def test_query_empty_repr(): assert repr(QueryExpression()) == "QueryExpression()"