home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where author_association = "OWNER" and issue = 1059555791 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 7

issue 1

  • Columns starting with an underscore behave poorly in filters · 7 ✖

author_association 1

  • OWNER · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1012653109 https://github.com/simonw/datasette/issues/1527#issuecomment-1012653109 https://api.github.com/repos/simonw/datasette/issues/1527 IC_kwDOBm6k_c48W9w1 simonw 9599 2022-01-14T00:57:08Z 2022-01-14T00:57:08Z OWNER

Bug is fixed on https://latest.datasette.io/fixtures/facetable?_sort=pk&_city_id__gt=1

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Columns starting with an underscore behave poorly in filters 1059555791  
1012635696 https://github.com/simonw/datasette/issues/1527#issuecomment-1012635696 https://api.github.com/repos/simonw/datasette/issues/1527 IC_kwDOBm6k_c48W5gw simonw 9599 2022-01-14T00:19:10Z 2022-01-14T00:20:36Z OWNER

Oh! This is because _city_id has a leading underscore (for testing purposes). I think I need to filter out any keys that contain __ in that case.

What happens to columns that contain a __? They shouldn't be reflected in the hidden arguments either - this code is really only supposed to catch things like _where and _m2m_through= and _col - basically most of the list on https://docs.datasette.io/en/stable/json_api.html#special-table-arguments

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Columns starting with an underscore behave poorly in filters 1059555791  
1012634659 https://github.com/simonw/datasette/issues/1527#issuecomment-1012634659 https://api.github.com/repos/simonw/datasette/issues/1527 IC_kwDOBm6k_c48W5Qj simonw 9599 2022-01-14T00:17:00Z 2022-01-14T00:18:11Z OWNER

That's because that page has this unnecessary hidden form field: html <input type="hidden" name="_city_id__gt" value="1"> That field is added by this bit in the template: https://github.com/simonw/datasette/blob/515f8d38ebae203efc15ca79a8b42848276b35e5/datasette/templates/table.html#L119-L122

Which is populated here: https://github.com/simonw/datasette/blob/ace86566b28280091b3844cf5fbecd20158e9004/datasette/views/table.py#L813-L821

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Columns starting with an underscore behave poorly in filters 1059555791  
988154238 https://github.com/simonw/datasette/issues/1527#issuecomment-988154238 https://api.github.com/repos/simonw/datasette/issues/1527 IC_kwDOBm6k_c465gl- simonw 9599 2021-12-07T18:05:26Z 2021-12-07T18:05:26Z OWNER

Found a new case of this bug: click the "Apply" button on https://latest.datasette.io/fixtures/facetable?_sort=pk&_city_id__gt=1

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Columns starting with an underscore behave poorly in filters 1059555791  
982318745 https://github.com/simonw/datasette/issues/1527#issuecomment-982318745 https://api.github.com/repos/simonw/datasette/issues/1527 IC_kwDOBm6k_c46jP6Z simonw 9599 2021-11-30T06:11:21Z 2021-11-30T06:11:21Z OWNER

Manually tested this too, looks like that fixed it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Columns starting with an underscore behave poorly in filters 1059555791  
982235541 https://github.com/simonw/datasette/issues/1527#issuecomment-982235541 https://api.github.com/repos/simonw/datasette/issues/1527 IC_kwDOBm6k_c46i7mV simonw 9599 2021-11-30T02:57:34Z 2021-11-30T02:58:44Z OWNER

I started fiddling with a test for this which extracts the <select> options and ALL of the <input> fields, but I probably won't use it: python def test_exact_parameter_results_in_correct_hidden_fields(app_client): # https://github.com/simonw/datasette/issues/1527 response = app_client.get( "/fixtures/facetable?_facet=_neighborhood&_neighborhood__exact=Downtown" ) # In this case we should NOT have a hidden _neighborhood__exact=Downtown field form = Soup(response.body, "html.parser").find("form") selects = [ { "name": select["name"], "value": select.select("option[selected]")[0].text if select.select("option[selected]") else "", } for select in form.findAll("select") ] inputs = [input.attrs for input in form.findAll("input")] # Turn those both into a {name: (value, type)} array form_inputs = {} form_inputs.update( {select["name"]: (select["value"], "select") for select in selects} ) form_inputs.update( { input["name"]: (input.get("value"), input["type"]) for input in inputs if input.get("name") } ) assert form_inputs == { "_filter_column_1": ("_neighborhood", "select"), "_filter_op_1": ("=", "select"), "_filter_value_1": ("Downtown", "text"), "_filter_column": ("", "select"), "_filter_op": ("", "select"), "_filter_value": (None, "text"), "_sort": ("Sort by pk", "select"), "_sort_by_desc": (None, "checkbox"), "_facet": ("_neighborhood", "hidden"), "_neighborhood__exact": ("Downtown", "hidden"), } The problem is that last hidden field, _neighborhood__exact=Downtown - which should not be there.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Columns starting with an underscore behave poorly in filters 1059555791  
974979785 https://github.com/simonw/datasette/issues/1527#issuecomment-974979785 https://api.github.com/repos/simonw/datasette/issues/1527 IC_kwDOBm6k_c46HQLJ simonw 9599 2021-11-22T01:02:57Z 2021-11-22T01:03:19Z OWNER

I think the root cause is this hidden form field on https://latest.datasette.io/fixtures/facetable?_facet=_neighborhood&_neighborhood__exact=Downtown html <input type="hidden" name="_facet" value="_neighborhood"> <input type="hidden" name="_neighborhood__exact" value="Downtown"> <input type="submit" value="Apply">

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Columns starting with an underscore behave poorly in filters 1059555791  

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