We're working on writing a wrapper for [bq.py](https://developers.google.com/bigquery/bq-command-line-tool) and are having some problems with result sets larger than 100k rows. It seems like in the past this has worked fine (we had related problems with [Google BigQuery Incomplete Query Replies on Odd Attempts](https://stackoverflow.com/questions/17751944/google-bigquery-incomplete-query-replies-on-odd-attempts)). Perhaps I'm not understanding the limits explained on the [doc page](https://developers.google.com/bigquery/docs/data)?

For instance:

```sh
#!/bin/bash

for i in `seq 99999 100002`;
do
    bq query -q --nouse_cache --max_rows 99999999 "SELECT id, FROM [publicdata:samples.wikipedia] LIMIT $i" > $i.txt
    j=$(cat $i.txt | wc -l)
    echo "Limit $i Returned $j Rows"
done

```

Yields (note there are 4 lines of formatting):

```none
Limit 99999 Returned   100003 Rows
Limit 100000 Returned   100004 Rows
Limit 100001 Returned   100004 Rows
Limit 100002 Returned   100004 Rows

```

In our wrapper, we directly access the API:

```python
while row_count < total_rows:
    data = client.apiclient.tabledata().list(maxResults=total_rows - row_count,
                                                 pageToken=page_token,
                                                 **table_dict).execute()

    # If there are more results than will fit on a page, 
    # you will recieve a token for the next page
    page_token = data.get('pageToken', None)

    # How many rows are there across all pages?
    total_rows = min(total_rows, int(data['totalRows'])) # Changed to use get(data[rows],0)
    raw_page = data.get('rows', [])

```

We would expect to get a token in this case, but none is returned.