home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

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

  • Make original path available to render hooks · 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
766484435 https://github.com/simonw/datasette/issues/1179#issuecomment-766484435 https://api.github.com/repos/simonw/datasette/issues/1179 MDEyOklzc3VlQ29tbWVudDc2NjQ4NDQzNQ== simonw 9599 2021-01-25T01:31:36Z 2021-01-25T01:31:36Z OWNER

Relevant existing tests: https://github.com/simonw/datasette/blob/461670a0b87efa953141b449a9a261919864ceb3/tests/test_utils.py#L365-L398

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make original path available to render hooks 780278550  
766484257 https://github.com/simonw/datasette/issues/1179#issuecomment-766484257 https://api.github.com/repos/simonw/datasette/issues/1179 MDEyOklzc3VlQ29tbWVudDc2NjQ4NDI1Nw== simonw 9599 2021-01-25T01:30:57Z 2021-01-25T01:30:57Z OWNER

The challenge here is figuring out what the original path, without the .format, actually was - while taking into account that Datasette has a special case for tables that themselves end in a .something.

The path_with_format() function nearly does what we need here:

https://github.com/simonw/datasette/blob/b6a7b58fa01af0cd5a5e94bd17d686d283a46819/datasette/utils/init.py#L710-L729

It can be called with replace_format="csv" to REMOVE the .csv format and replace it with something else.

Problem is, we want to use it to get rid of the format entirely.

We could update path_with_format() to accept format='' to mean "remove the format entirely", but it's a bit messy. It may be better to reconsider the design of path_with_format() and related utility functions entirely.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make original path available to render hooks 780278550  
766434629 https://github.com/simonw/datasette/issues/1179#issuecomment-766434629 https://api.github.com/repos/simonw/datasette/issues/1179 MDEyOklzc3VlQ29tbWVudDc2NjQzNDYyOQ== simonw 9599 2021-01-24T21:23:47Z 2021-01-24T21:23:47Z OWNER

I'm just going to do path and full_path (which includes the querystring). Thedatasette.absolute_url()` method can be used by plugins that need the full URL.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make original path available to render hooks 780278550  
755495387 https://github.com/simonw/datasette/issues/1179#issuecomment-755495387 https://api.github.com/repos/simonw/datasette/issues/1179 MDEyOklzc3VlQ29tbWVudDc1NTQ5NTM4Nw== simonw 9599 2021-01-06T18:39:23Z 2021-01-06T18:39:23Z OWNER

In that case maybe there are three new arguments: path, full_path and url.

I'll also add request.full_path for consistency with these: https://github.com/simonw/datasette/blob/97fb10c17dd007a275ab743742e93e932335ad67/datasette/utils/asgi.py#L77-L90

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make original path available to render hooks 780278550  
755492945 https://github.com/simonw/datasette/issues/1179#issuecomment-755492945 https://api.github.com/repos/simonw/datasette/issues/1179 MDEyOklzc3VlQ29tbWVudDc1NTQ5Mjk0NQ== simonw 9599 2021-01-06T18:37:39Z 2021-01-06T18:37:39Z OWNER

I think I'll call this full_path for consistency with Django.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make original path available to render hooks 780278550  
755489974 https://github.com/simonw/datasette/issues/1179#issuecomment-755489974 https://api.github.com/repos/simonw/datasette/issues/1179 MDEyOklzc3VlQ29tbWVudDc1NTQ4OTk3NA== simonw 9599 2021-01-06T18:35:24Z 2021-01-06T18:35:24Z OWNER

Django calls this HttpRequest.get_full_path() - for the path plus the querystring.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make original path available to render hooks 780278550  
755486103 https://github.com/simonw/datasette/issues/1179#issuecomment-755486103 https://api.github.com/repos/simonw/datasette/issues/1179 MDEyOklzc3VlQ29tbWVudDc1NTQ4NjEwMw== simonw 9599 2021-01-06T18:32:41Z 2021-01-06T18:34:11Z OWNER

This parameter will return the URL path, with querystring arguments, to the HTML version of the page - e.g. /github/issue_comments or /github/issue_comments?_sort_desc=created_at

Open questions:

  • What should it be called? path could be misleading since it also includes the querystring.
  • Should I provide a url or full_url version which includes https://blah.com/...?
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make original path available to render hooks 780278550  
755161574 https://github.com/simonw/datasette/issues/1179#issuecomment-755161574 https://api.github.com/repos/simonw/datasette/issues/1179 MDEyOklzc3VlQ29tbWVudDc1NTE2MTU3NA== simonw 9599 2021-01-06T08:32:31Z 2021-01-06T08:32:31Z OWNER

An optional path argument to https://docs.datasette.io/en/stable/plugin_hooks.html#register-output-renderer-datasette which shows the path WITHOUT the .Notebook extension would be useful here.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make original path available to render hooks 780278550  

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