issue_comments

16 rows where issue = 322477187 sorted by updated_at descending

View and edit SQL

Suggested facets: created_at (date), updated_at (date)

user

issue

  • Facets · 16

author_association

id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue
390999055 https://github.com/simonw/datasette/issues/255#issuecomment-390999055 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM5MDk5OTA1NQ== simonw 9599 2018-05-22T13:54:55Z 2018-05-22T13:54:55Z OWNER

This shipped in Datasette 0.22. Here's my blog post about it: https://simonwillison.net/2018/May/20/datasette-facets/

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
389562708 https://github.com/simonw/datasette/issues/255#issuecomment-389562708 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4OTU2MjcwOA== simonw 9599 2018-05-16T15:32:12Z 2018-05-16T15:32:12Z OWNER

This is now landed in master, ready for the next release.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
389546040 https://github.com/simonw/datasette/issues/255#issuecomment-389546040 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4OTU0NjA0MA== simonw 9599 2018-05-16T14:47:34Z 2018-05-16T14:47:34Z OWNER

Latest demo - now with multiple columns: https://datasette-suggested-facets-demo.now.sh/sf-trees-02c8ef1/Street_Tree_List?_facet=qCaretaker&_facet=qCareAssistant&_facet=qLegalStatus

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
389397457 https://github.com/simonw/datasette/issues/255#issuecomment-389397457 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4OTM5NzQ1Nw== simonw 9599 2018-05-16T05:20:04Z 2018-05-16T05:20:04Z OWNER

Maybe suggested_facets should only be calculated for the HTML view.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
389386919 https://github.com/simonw/datasette/issues/255#issuecomment-389386919 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4OTM4NjkxOQ== simonw 9599 2018-05-16T03:57:47Z 2018-05-16T03:58:30Z OWNER

I updated that demo to demonstrate the new foreign key label expansions: https://datasette-suggested-facets-demo.now.sh/sf-trees-02c8ef1/Street_Tree_List?_facet=qLegalStatus

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
389147608 https://github.com/simonw/datasette/issues/255#issuecomment-389147608 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4OTE0NzYwOA== simonw 9599 2018-05-15T12:24:46Z 2018-05-15T12:24:46Z OWNER

New demo (published with datasette publish now --branch=suggested-facets fivethirtyeight.db sf-trees.db --name=datastte-suggested-facets-demo): https://datasette-suggested-facets-demo.now.sh/fivethirtyeight-2628db9/comic-characters%2Fmarvel-wikia-data

After turning on a couple of suggested facets... https://datasette-suggested-facets-demo.now.sh/fivethirtyeight-2628db9/comic-characters%2Fmarvel-wikia-data?_facet=SEX&_facet=ID

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
389145872 https://github.com/simonw/datasette/issues/255#issuecomment-389145872 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4OTE0NTg3Mg== simonw 9599 2018-05-15T12:17:52Z 2018-05-15T12:17:52Z OWNER

Activity has now moved to this branch: https://github.com/simonw/datasette/commits/suggested-facets

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
388784787 https://github.com/simonw/datasette/issues/255#issuecomment-388784787 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4ODc4NDc4Nw== simonw 9599 2018-05-14T11:28:05Z 2018-05-14T11:28:05Z OWNER

To decide which facets to suggest: for each column, is the unique value count less than the number of rows matching the current query or is it less than 20 (if we are showing more than 20 rows)?

Maybe only do this if there are less than ten non-float columns. Or always try for foreign keys and booleans, then if there are none of those try indexed text and integer fields, then finally try non-indexed text and integer fields but only if there are less than ten.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
388784063 https://github.com/simonw/datasette/issues/255#issuecomment-388784063 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4ODc4NDA2Mw== simonw 9599 2018-05-14T11:25:00Z 2018-05-14T11:25:15Z OWNER

Can I get facets working across many2many relationships?

This would be fiendishly useful, but the querystring and metadata.json syntax is non-obvious.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
388686463 https://github.com/simonw/datasette/issues/255#issuecomment-388686463 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4ODY4NjQ2Mw== simonw 9599 2018-05-14T03:23:44Z 2018-05-14T03:25:22Z OWNER

It would be neat if there was a mechanism for calculating aggregates per facet - e.g. calculating the sum() of specific columns against each facet result on https://datasette-facets-demo.now.sh/fivethirtyeight-2628db9/nba-elo%2Fnbaallelo?_facet=lg_id&_facet=fran_id&lg_id=ABA&_facet=team_id

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
388645828 https://github.com/simonw/datasette/issues/255#issuecomment-388645828 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4ODY0NTgyOA== simonw 9599 2018-05-13T18:18:56Z 2018-05-13T18:20:02Z OWNER

I may be able to run the SQL for all of the facet counts in one go using a WITH CTE query - will have to microbenchmark this to make sure it is worthwhile: https://datasette-facets-demo.now.sh/fivethirtyeight-2628db9?sql=with+blah+as+%28select++from+%5Bcollege-majors%2Fall-ages%5D%29%0D%0Aselect++from+%28select+%22Major_category%22%2C+Major_category%2C+count%28%29+as+n+from%0D%0Ablah+group+by+Major_category+order+by+n+desc+limit+10%29%0D%0Aunion+all%0D%0Aselect++from+%28select+%22Major_category2%22%2C+Major_category%2C+count%28*%29+as+n+from%0D%0Ablah+group+by+Major_category+order+by+n+desc+limit+10%29

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
388588998 https://github.com/simonw/datasette/issues/255#issuecomment-388588998 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4ODU4ODk5OA== simonw 9599 2018-05-12T22:57:30Z 2018-05-12T23:00:24Z OWNER

A few demos:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
388589072 https://github.com/simonw/datasette/issues/255#issuecomment-388589072 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4ODU4OTA3Mg== simonw 9599 2018-05-12T22:59:07Z 2018-05-12T22:59:07Z OWNER

I need to decide how to display these. They currently look like this:

https://datasette-facets-demo.now.sh/fivethirtyeight-2628db9/congress-age%2Fcongress-terms?_facet=chamber&_facet=state&_facet=party&_facet=incumbent&state=MO

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
388588011 https://github.com/simonw/datasette/issues/255#issuecomment-388588011 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4ODU4ODAxMQ== simonw 9599 2018-05-12T22:33:39Z 2018-05-12T22:33:39Z OWNER

Initial documentation: http://datasette.readthedocs.io/en/latest/facets.html

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
388587855 https://github.com/simonw/datasette/issues/255#issuecomment-388587855 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4ODU4Nzg1NQ== simonw 9599 2018-05-12T22:30:23Z 2018-05-12T22:30:23Z OWNER

Adding some TODOs to the original description (so they show up as a todo progress bar)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187
388525357 https://github.com/simonw/datasette/issues/255#issuecomment-388525357 https://api.github.com/repos/simonw/datasette/issues/255 MDEyOklzc3VlQ29tbWVudDM4ODUyNTM1Nw== simonw 9599 2018-05-12T03:01:14Z 2018-05-12T03:01:14Z OWNER

Facet counts will be generated by extra SQL queries with their own aggressive time limit.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets 322477187

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Query took 35.701ms · About: github-to-sqlite