issue_comments
11 rows where "created_at" is on date 2020-12-12 sorted by id
This data as json, CSV (advanced)
Suggested facets: issue_url
user 2
- simonw 10
- nitinpaultifr 1
id ▼ | html_url | issue_url | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
743701422 | https://github.com/simonw/sqlite-utils/issues/207#issuecomment-743701422 | https://api.github.com/repos/simonw/sqlite-utils/issues/207 | MDEyOklzc3VlQ29tbWVudDc0MzcwMTQyMg== | simonw 9599 | 2020-12-12T04:37:14Z | 2020-12-12T04:38:25Z | OWNER | Prototype: ```python from collections import namedtuple ColumnDetails = namedtuple("ColumnDetails", ("column", "num_null", "num_blank", "num_distinct", "most_common", "least_common")) def analyze_column(db, table, column, values=10): num_null = db.execute("select count() from [{}] where [{}] is null".format(table, column)).fetchone()[0] num_blank = db.execute("select count() from [{}] where [{}] = ''".format(table, column)).fetchone()[0] num_distinct = db.execute("select count(distinct [{}]) from [{}]".format(column, table)).fetchone()[0] most_common = None least_common = None if num_distinct != 1: most_common = [(r[0], r[1]) for r in db.execute( "select [{}], count() from [{}] group by [{}] order by count() desc limit ".format(column, table, column, values) ).fetchall()] if num_distinct <= values: # No need to run the query if it will just return the results in revers order least_common = most_common[::-1] else: least_common = [(r[0], r[1]) for r in db.execute( "select [{}], count() from [{}] group by [{}] order by count() limit {}".format(column, table, column, values) ).fetchall()] return ColumnDetails(column, num_null, num_blank, num_distinct, most_common, least_common) def analyze_table(db, table): for column in db[table].columns: details = analyze_column(db, table, column.name) print(details) ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils analyze-tables command 763283616 | |
743701599 | https://github.com/simonw/sqlite-utils/issues/207#issuecomment-743701599 | https://api.github.com/repos/simonw/sqlite-utils/issues/207 | MDEyOklzc3VlQ29tbWVudDc0MzcwMTU5OQ== | simonw 9599 | 2020-12-12T04:38:52Z | 2020-12-12T04:39:07Z | OWNER | I'll add a |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils analyze-tables command 763283616 | |
743701697 | https://github.com/simonw/sqlite-utils/issues/207#issuecomment-743701697 | https://api.github.com/repos/simonw/sqlite-utils/issues/207 | MDEyOklzc3VlQ29tbWVudDc0MzcwMTY5Nw== | simonw 9599 | 2020-12-12T04:39:51Z | 2020-12-12T04:39:51Z | OWNER | CLI could be:
To analyze all tables or:
To analyze specific tables. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils analyze-tables command 763283616 | |
743707969 | https://github.com/simonw/sqlite-utils/pull/208#issuecomment-743707969 | https://api.github.com/repos/simonw/sqlite-utils/issues/208 | MDEyOklzc3VlQ29tbWVudDc0MzcwNzk2OQ== | simonw 9599 | 2020-12-12T05:42:26Z | 2020-12-12T05:43:06Z | OWNER | Should truncate values in the least/most common JSON array to a sensible length, otherwise you end up with stuff like this:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils analyze-tables command and table.analyze_column() method 763320133 | |
743708080 | https://github.com/simonw/sqlite-utils/pull/208#issuecomment-743708080 | https://api.github.com/repos/simonw/sqlite-utils/issues/208 | MDEyOklzc3VlQ29tbWVudDc0MzcwODA4MA== | simonw 9599 | 2020-12-12T05:43:45Z | 2020-12-12T05:43:45Z | OWNER | CLI output looks like this at the moment, which is bad:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils analyze-tables command and table.analyze_column() method 763320133 | |
743708169 | https://github.com/simonw/sqlite-utils/pull/208#issuecomment-743708169 | https://api.github.com/repos/simonw/sqlite-utils/issues/208 | MDEyOklzc3VlQ29tbWVudDc0MzcwODE2OQ== | simonw 9599 | 2020-12-12T05:44:46Z | 2020-12-12T05:44:46Z | OWNER | If there are less than ten values is it worth outputting them twice, once in |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils analyze-tables command and table.analyze_column() method 763320133 | |
743708325 | https://github.com/simonw/sqlite-utils/pull/208#issuecomment-743708325 | https://api.github.com/repos/simonw/sqlite-utils/issues/208 | MDEyOklzc3VlQ29tbWVudDc0MzcwODMyNQ== | simonw 9599 | 2020-12-12T05:46:27Z | 2020-12-12T05:46:27Z | OWNER | It would be neat if you could optionally specify a subset of columns to analyze, using |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils analyze-tables command and table.analyze_column() method 763320133 | |
743708524 | https://github.com/simonw/sqlite-utils/pull/208#issuecomment-743708524 | https://api.github.com/repos/simonw/sqlite-utils/issues/208 | MDEyOklzc3VlQ29tbWVudDc0MzcwODUyNA== | simonw 9599 | 2020-12-12T05:48:20Z | 2020-12-12T05:48:32Z | OWNER |
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils analyze-tables command and table.analyze_column() method 763320133 | |
743732440 | https://github.com/simonw/datasette/issues/1142#issuecomment-743732440 | https://api.github.com/repos/simonw/datasette/issues/1142 | MDEyOklzc3VlQ29tbWVudDc0MzczMjQ0MA== | nitinpaultifr 6622733 | 2020-12-12T09:56:40Z | 2020-12-12T09:56:40Z | NONE | 'Include all rows' seem like a fairly obvious alternative |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"Stream all rows" is not at all obvious 763361458 | |
743912875 | https://github.com/simonw/datasette/issues/1142#issuecomment-743912875 | https://api.github.com/repos/simonw/datasette/issues/1142 | MDEyOklzc3VlQ29tbWVudDc0MzkxMjg3NQ== | simonw 9599 | 2020-12-12T22:16:38Z | 2020-12-12T22:16:38Z | OWNER | Yeah, maybe with the number of rows to make it completely clear. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"Stream all rows" is not at all obvious 763361458 | |
743913004 | https://github.com/simonw/datasette/issues/1142#issuecomment-743913004 | https://api.github.com/repos/simonw/datasette/issues/1142 | MDEyOklzc3VlQ29tbWVudDc0MzkxMzAwNA== | simonw 9599 | 2020-12-12T22:17:46Z | 2020-12-12T22:17:46Z | OWNER | You're actually choosing between two options here: the 100 rows you can see on the screen, or the x,000 rows that match the current query. Maybe a radio box would be more obvious? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
"Stream all rows" is not at all obvious 763361458 |
Advanced export
JSON shape: default, array, newline-delimited, object
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]) , [performed_via_github_app] TEXT); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
issue 3