datasette-cluster-map icon indicating copy to clipboard operation
datasette-cluster-map copied to clipboard

Showing 1,000 of 10,001 bug

Open simonw opened this issue 1 year ago • 2 comments

Image

This happens on more recent versions of Datasette that don't show the full count.

Easiest fix is to show "Showing 1,000 of >10,000".

simonw avatar Apr 16 '25 04:04 simonw

The API we call is /data/Street_Tree_List.json?_size=max&_labels=on&_extra=count&_extra=next_url&_shape=objects

Which now returns:

{
  "ok": true,
  "next": "1000",
  "next_url": ".../data/Street_Tree_List.json?_size=max&_labels=on&_extra=count&_extra=next_url&_shape=objects&_next=1000",
  "count": 10001,
  "rows": [],
  "truncated": false
}

Can we tell from this that the 10,001 number actually represents "there's at least one more page"?

I'm not sure we can. May need a supporting change in Datasette itself.

simonw avatar Apr 16 '25 04:04 simonw

In the template: https://github.com/simonw/datasette/blob/d021ce97aa60c48441bad7a976112b2bb11f6ccd/datasette/templates/table.html#L44

{% if count == count_limit + 1 %}>{{ "{:,}".format(count_limit) }} rows

We don't expose count_limit in the JSON yet.

simonw avatar Apr 16 '25 05:04 simonw