def METHOD_NAME(cls, cursor: Any, limit: Optional[int]) -> agate.Table:
    data: List[Any] = []
    column_names: List[str] = []
    if cursor.description is not None:
        column_names = [col[0] for col in cursor.description]
        if limit:
            rows = cursor.fetchmany(limit)
        else:
            rows = cursor.fetchall()
        data = cls.process_results(column_names, rows)
    return dbt.clients.agate_helper.table_from_data_flat(data, column_names)