allensdk.internal.api.queries.utils module¶
- allensdk.internal.api.queries.utils.build_in_list_selector_query(col: str, valid_list: List[SupportsStr] | None = None, operator: str = 'WHERE', valid: bool = True) str [source]¶
Filter for rows where the value of a column is contained in a list (or, if valid=False, where the value is not contained in that list). If no list is specified in valid_list, return an empty string.
- Parameters:
- col: str
The name of the column being filtered on
- valid_list: Optional[SupportsStr]
The list of values to test column on
- operator: str
The SQL operator that starts the clause (“WHERE”, “AND” or “OR”)
- valid: bool
If True, test for “col IN valid_list”; else, test for “col NOT IN valid_list”
- Returns:
- session_query: str
The clause performing the request filter