def _generate_sql(self, params):
        query_params = shared.TaskState.projection_params()
        return { k: v or '' for k, v in {
            'cancelled_cond': shared.TaskState.CANCELLED_CONDITION,
            'error_cond': shared.TaskState.ERROR_CONDITION,
            'finished_cond': shared.TaskState.FINISHED_CONDITION,
            'queued_cond': shared.TaskState.QUEUED_CONDITION,
            'state_projection': shared.JobState.PROJECTION,
            'order': params['order'],
            'order_by': params['order_by'],
            'where_expr': self._state_predicate(params, query_params),
            'paging': self._paging(params, query_params)
        }.iteritems() }, query_params
dataset/ETHPy150Open memsql/memsql-loader/memsql_loader/api/jobs.py/Jobs._generate_sql/original