home / github

Menu
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where "created_at" is on date 2022-03-07 and issue = 1161584460

✎ View and edit SQL

This data as json, CSV (advanced)

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

id ▼ html_url issue_url node_id user created_at updated_at author_association body reactions issue performed_via_github_app
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  
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 that `get_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  
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  
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  
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](https://github.com/simonw/datasette/blob/c5791156d92615f25696ba93dae5bb2dcc192c98/datasette/app.py#L997-L1107) 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  

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 15.861ms · About: simonw/datasette-graphql