home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 781262510 and user = 9599 sorted by updated_at descending

✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • simonw · 3 ✖

issue 1

  • Certain database names results in 404: "Database not found: None" · 3 ✖

author_association 1

  • OWNER 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
761703555 https://github.com/simonw/datasette/issues/1181#issuecomment-761703555 https://api.github.com/repos/simonw/datasette/issues/1181 MDEyOklzc3VlQ29tbWVudDc2MTcwMzU1NQ== simonw 9599 2021-01-17T00:24:20Z 2021-01-17T00:24:40Z OWNER

Here's the incomplete sketch of a test - to go at the bottom of test_cli.py.

python @pytest.mark.parametrize( "filename", ["test-database (1).sqlite", "database (1).sqlite"] ) def test_weird_database_names(ensure_eventloop, tmpdir, filename): # https://github.com/simonw/datasette/issues/1181 runner = CliRunner() db_path = str(tmpdir / filename) sqlite3.connect(db_path).execute("vacuum") result1 = runner.invoke(cli, [db_path, "--get", "/"]) assert result1.exit_code == 0, result1.output homepage_html = result1.output assert False

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Certain database names results in 404: "Database not found: None" 781262510  
756487966 https://github.com/simonw/datasette/issues/1181#issuecomment-756487966 https://api.github.com/repos/simonw/datasette/issues/1181 MDEyOklzc3VlQ29tbWVudDc1NjQ4Nzk2Ng== simonw 9599 2021-01-08T01:25:42Z 2021-01-08T01:25:42Z OWNER

I'm going to add a unit test that tries a variety of weird database names.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Certain database names results in 404: "Database not found: None" 781262510  
756482163 https://github.com/simonw/datasette/issues/1181#issuecomment-756482163 https://api.github.com/repos/simonw/datasette/issues/1181 MDEyOklzc3VlQ29tbWVudDc1NjQ4MjE2Mw== simonw 9599 2021-01-08T01:06:23Z 2021-01-08T01:06:54Z OWNER

Yes, that logic is definitely at fault. It looks like it applies urllib.parse.unquote_plus() AFTER it's tried to do the - hash splitting thing, which is why it's failing here:

https://github.com/simonw/datasette/blob/97fb10c17dd007a275ab743742e93e932335ad67/datasette/views/base.py#L184-L198

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Certain database names results in 404: "Database not found: None" 781262510  

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])
, [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]);
Powered by Datasette · Queries took 425.271ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows