home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 733796942 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 6

issue 1

  • PrefixedUrlString mechanism broke everything · 6 ✖

author_association 1

  • OWNER 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
719983750 https://github.com/simonw/datasette/issues/1075#issuecomment-719983750 https://api.github.com/repos/simonw/datasette/issues/1075 MDEyOklzc3VlQ29tbWVudDcxOTk4Mzc1MA== simonw 9599 2020-10-31T20:22:29Z 2020-10-31T20:22:29Z OWNER

I bet this is because I'm mucking around with one of those __ methods. I'll try just doing the non-underscore methods instead.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
PrefixedUrlString mechanism broke everything 733796942  
719983565 https://github.com/simonw/datasette/issues/1075#issuecomment-719983565 https://api.github.com/repos/simonw/datasette/issues/1075 MDEyOklzc3VlQ29tbWVudDcxOTk4MzU2NQ== simonw 9599 2020-10-31T20:21:03Z 2020-10-31T20:21:03Z OWNER

Here's the output of dir(str):

['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
PrefixedUrlString mechanism broke everything 733796942  
719983484 https://github.com/simonw/datasette/issues/1075#issuecomment-719983484 https://api.github.com/repos/simonw/datasette/issues/1075 MDEyOklzc3VlQ29tbWVudDcxOTk4MzQ4NA== simonw 9599 2020-10-31T20:20:28Z 2020-10-31T20:20:28Z OWNER

It looks like this is specific to the way PrefixedUrlString is built. (Pdb) class Weird(str): pass (Pdb) isinstance(Weird('bob'), collections.abc.Awaitable) False So subclassing strings doesn't trigger this bug, but something about PrefixedUrlString causes the problem.

Here's the current PrefixedUrlString implementation:

https://github.com/simonw/datasette/blob/bf18b9ba175a7b25fb8b765847397dd6efb8bb7b/datasette/utils/init.py#L1015-L1035

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
PrefixedUrlString mechanism broke everything 733796942  
719983240 https://github.com/simonw/datasette/issues/1075#issuecomment-719983240 https://api.github.com/repos/simonw/datasette/issues/1075 MDEyOklzc3VlQ29tbWVudDcxOTk4MzI0MA== simonw 9599 2020-10-31T20:18:49Z 2020-10-31T20:18:49Z OWNER

Here's the core problem: (Pdb) isinstance('bob', collections.abc.Awaitable) False (Pdb) isinstance(PrefixedUrlString('bob'), collections.abc.Awaitable) *** TypeError: issubclass() arg 1 must be a class For some reason isinstance() does not like being handed an instance of PrefixedUrlString.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
PrefixedUrlString mechanism broke everything 733796942  
719981173 https://github.com/simonw/datasette/issues/1075#issuecomment-719981173 https://api.github.com/repos/simonw/datasette/issues/1075 MDEyOklzc3VlQ29tbWVudDcxOTk4MTE3Mw== simonw 9599 2020-10-31T20:02:30Z 2020-10-31T20:03:45Z OWNER

I wonder how Jinja's Markup() class works? It uses https://pypi.org/project/MarkupSafe/

It's a subclass of str, defined here: https://github.com/pallets/markupsafe/blob/master/src/markupsafe/init.py

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
PrefixedUrlString mechanism broke everything 733796942  
719980742 https://github.com/simonw/datasette/issues/1075#issuecomment-719980742 https://api.github.com/repos/simonw/datasette/issues/1075 MDEyOklzc3VlQ29tbWVudDcxOTk4MDc0Mg== simonw 9599 2020-10-31T19:58:57Z 2020-10-31T19:58:57Z OWNER

Sample traceback: ``` <link rel="stylesheet" href="{{ urls.static('app.css') }}?{{ app_css_hash }}"> /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/jinja2/asyncsupport.py:173: in auto_await if inspect.isawaitable(value): /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/inspect.py:226: in isawaitable isinstance(object, collections.abc.Awaitable)) /opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/abc.py:139: in instancecheck return _abc_instancecheck(cls, instance)


cls = <class 'collections.abc.Awaitable'> subclass = <bound method PrefixedUrlString.__getattribute__.\<locals>.method of '/-/static/app.css'>

def __subclasscheck__(cls, subclass):
    """Override for issubclass(subclass, cls)."""
  return _abc_subclasscheck(cls, subclass)

E TypeError: issubclass() arg 1 must be a class `` This is within Jinja. It looks like Jinja really doesn't like methods that return non-string objects likePrefixedUrlString`.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
PrefixedUrlString mechanism broke everything 733796942  

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