Indentation is not correct here

    def __init__(
        self,
        sql_select='COUNT(1)', sql_from=None, sql_where='1', sql_query=None,
        **params
    ):

is probably better — most importantly, indentation can only be increased by one level and `):` should be at the same level as `def`.