home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 1161584460 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 8

issue 1

  • Get rid of the no-longer necessary ?_format=json hack for tables called x.json · 8 ✖

author_association 1

  • OWNER 8
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1068319530 https://github.com/simonw/datasette/issues/1651#issuecomment-1068319530 https://api.github.com/repos/simonw/datasette/issues/1651 IC_kwDOBm6k_c4_rUMq simonw 9599 2022-03-15T18:25:42Z 2022-03-15T18:25:42Z OWNER

Done:

  • https://latest.datasette.io/fixtures/table~2Fwith~2Fslashes~2Ecsv
  • https://latest.datasette.io/fixtures/table~2Fwith~2Fslashes~2Ecsv.csv
  • https://latest.datasette.io/fixtures/table~2Fwith~2Fslashes~2Ecsv.json
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Get rid of the no-longer necessary ?_format=json hack for tables called x.json 1161584460  
1067382442 https://github.com/simonw/datasette/issues/1651#issuecomment-1067382442 https://api.github.com/repos/simonw/datasette/issues/1651 IC_kwDOBm6k_c4_nvaq simonw 9599 2022-03-14T22:59:10Z 2022-03-14T22:59:10Z OWNER

This work is now blocked on: - https://github.com/simonw/datasette/issues/1657

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Get rid of the no-longer necessary ?_format=json hack for tables called x.json 1161584460  
1061359915 https://github.com/simonw/datasette/issues/1651#issuecomment-1061359915 https://api.github.com/repos/simonw/datasette/issues/1651 IC_kwDOBm6k_c4_QxEr simonw 9599 2022-03-08T03:08:14Z 2022-03-08T03:09:24Z OWNER

A lot of the code complexity here is caused by DataView (here), which has the logic for CSV streaming and plugin formats such that it can be shared between tables and custom queries.

It would be good to get rid of that subclassed shared code, figure out how to do it via a utility function instead.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Get rid of the no-longer necessary ?_format=json hack for tables called x.json 1161584460  
1061223822 https://github.com/simonw/datasette/issues/1651#issuecomment-1061223822 https://api.github.com/repos/simonw/datasette/issues/1651 IC_kwDOBm6k_c4_QP2O simonw 9599 2022-03-07T22:54:54Z 2022-03-07T22:54:54Z OWNER

I'm going to do a review of how URL routing works at the moment for the various views.

I edited down the full list a bit - these are the most relevant: python add_route(IndexView.as_view(self), r"/(?P<as_format>(\.jsono?)?$)") add_route( DatabaseView.as_view(self), r"/(?P<db_name>[^/]+?)(?P<as_format>" + renderer_regex + r"|.jsono|\.csv)?$", ) add_route( TableView.as_view(self), r"/(?P<db_name>[^/]+)/(?P<table_and_format>[^/]+?$)", ) add_route( RowView.as_view(self), r"/(?P<db_name>[^/]+)/(?P<table>[^/]+?)/(?P<pk_path>[^/]+?)(?P<as_format>" + renderer_regex + r")?$", )

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Get rid of the no-longer necessary ?_format=json hack for tables called x.json 1161584460  
1061170897 https://github.com/simonw/datasette/issues/1651#issuecomment-1061170897 https://api.github.com/repos/simonw/datasette/issues/1651 IC_kwDOBm6k_c4_QC7R simonw 9599 2022-03-07T21:48:35Z 2022-03-07T21:48:35Z OWNER

My attempts to simplify get_format() keep resulting in errors like this one: File "/Users/simon/Dropbox/Development/datasette/datasette/views/base.py", line 474, in view_get response_or_template_contexts = await self.data( TypeError: TableView.data() missing 1 required positional argument: 'table' I really need to clean this up.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Get rid of the no-longer necessary ?_format=json hack for tables called x.json 1161584460  
1061169528 https://github.com/simonw/datasette/issues/1651#issuecomment-1061169528 https://api.github.com/repos/simonw/datasette/issues/1651 IC_kwDOBm6k_c4_QCl4 simonw 9599 2022-03-07T21:47:01Z 2022-03-07T21:47:01Z OWNER

Wow, this code is difficult to follow! Look at this bit inside the get_format() method:

https://github.com/simonw/datasette/blob/bb499942c15c4e2cfa4b6afab8f8debe5948c009/datasette/views/base.py#L469-L478

That's modifying the arguments that were extracted from the path by the routing regular expressions to have table as dash-decoded value! So calling.get_format()` has the side effect of decoding the table names for you. Nasty.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Get rid of the no-longer necessary ?_format=json hack for tables called x.json 1161584460  
1061053094 https://github.com/simonw/datasette/issues/1651#issuecomment-1061053094 https://api.github.com/repos/simonw/datasette/issues/1651 IC_kwDOBm6k_c4_PmKm simonw 9599 2022-03-07T19:29:01Z 2022-03-07T19:29:01Z OWNER

I found an obscure bug in #1650 which I can fix with this too. The following test should pass: python @pytest.mark.parametrize( "path,expected", ( ( "/fivethirtyeight/twitter-ratio%2Fsenators", "/fivethirtyeight/twitter-2Dratio-2Fsenators", ), ( "/fixtures/table%2Fwith%2Fslashes.csv", "/fixtures/table-2Fwith-2Fslashes-2Ecsv", ), # query string should be preserved ("/foo/bar%2Fbaz?id=5", "/foo/bar-2Fbaz?id=5"), ), ) def test_redirect_percent_encoding_to_dash_encoding(app_client, path, expected): response = app_client.get(path) assert response.status == 302 assert response.headers["location"] == expected It currently fails like this: ```

  assert response.headers["location"] == expected

E AssertionError: assert '/fixtures/table-2Fwith-2Fslashes.csv?_nofacet=1&_nocount=1' == '/fixtures/table-2Fwith-2Fslashes-2Ecsv' E - /fixtures/table-2Fwith-2Fslashes-2Ecsv E + /fixtures/table-2Fwith-2Fslashes.csv?_nofacet=1&_nocount=1 `` Because the logic in thatget_format()` function notices that the table exists, and then weird things happen here: https://github.com/simonw/datasette/blob/1baa030eca375f839f3471237547ab403523e643/datasette/views/base.py#L288-L303

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Get rid of the no-longer necessary ?_format=json hack for tables called x.json 1161584460  
1060853226 https://github.com/simonw/datasette/issues/1651#issuecomment-1060853226 https://api.github.com/repos/simonw/datasette/issues/1651 IC_kwDOBm6k_c4_O1Xq simonw 9599 2022-03-07T16:04:26Z 2022-03-07T16:04:26Z OWNER

Here's the relevant code:

https://github.com/simonw/datasette/blob/1baa030eca375f839f3471237547ab403523e643/datasette/utils/init.py#L753-L772

https://github.com/simonw/datasette/blob/1baa030eca375f839f3471237547ab403523e643/datasette/views/base.py#L451-L479

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Get rid of the no-longer necessary ?_format=json hack for tables called x.json 1161584460  

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 23.693ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows