home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where "updated_at" is on date 2020-05-21 and user = 9599 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 3

  • link_or_copy_directory() error - Invalid cross-device link 3
  • Create a public demo 3
  • Allow to specify a URL fragment for canned queries 1

author_association 2

  • OWNER 4
  • MEMBER 3

user 1

  • simonw · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
632398475 https://github.com/simonw/datasette/issues/767#issuecomment-632398475 https://api.github.com/repos/simonw/datasette/issues/767 MDEyOklzc3VlQ29tbWVudDYzMjM5ODQ3NQ== simonw 9599 2020-05-21T23:36:00Z 2020-05-21T23:36:00Z OWNER

Interesting. So this would take effect exclusively on pages that link to the queries, which I think just means this page: https://latest.datasette.io/fixtures

How about this for the design: there's a new optional key in the metadata configuration for a query called "fragment" - used like this:

json { "databases": { "fixtures": { "queries": { "neighborhood_search": { "sql": "\nselect neighborhood, facet_cities.name, state\nfrom facetable\n join facet_cities\n on facetable.city_id = facet_cities.id\nwhere neighborhood like '%' || :text || '%'\norder by neighborhood;\n", "title": "Search neighborhoods", "description_html": "<b>Demonstrating</b> simple like search", "name": "neighborhood_search", "fragment": "sql-format" } } } } } Because of the "fragment": "sql-format" bit there the link to that query from https://latest.datasette.io/fixtures would be to https://latest.datasette.io/fixtures/neighborhood_search#sql-format.

Does that cover what you need here? Have I missed anything?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Allow to specify a URL fragment for canned queries 620969465  
631253852 https://github.com/dogsheep/dogsheep-photos/issues/25#issuecomment-631253852 https://api.github.com/repos/dogsheep/dogsheep-photos/issues/25 MDEyOklzc3VlQ29tbWVudDYzMTI1Mzg1Mg== simonw 9599 2020-05-20T05:56:17Z 2020-05-21T22:26:16Z MEMBER

I have a deploy-demo.sh script now: ```bash

!/bin/bash

if [ -f public.db ]; then rm public.db fi pipenv run dogsheep-photos create-subset photos.db public.db \ "select sha256 from apple_photos where albums like '%Public%'" pipenv run sqlite-utils create-view public.db photos_on_a_map \ "select date, latitude, longitude, apple_photos.sha256, uploads.ext, json_object( 'title', 'Taken on ' || date, 'image', 'https://photos.simonwillison.net/i/' || uploads.sha256 || '.' || uploads.ext || '?w=400', 'link', 'https://photos.simonwillison.net/i/' || uploads.sha256 || '.' || uploads.ext || '?w=1200' ) as popup from apple_photos join uploads on apple_photos.sha256 = uploads.sha256 where latitude is not null order by date desc" \ --replace pipenv run datasette publish now public.db --project dogsheep-photos \ --about=dogsheep/dogsheep-photos \ --about_url="https://github.com/dogsheep/dogsheep-photos" \ --install=datasette-json-html \ --install=datasette-pretty-json \ --install=datasette-cluster-map>=0.10 \ --title "Dogsheep Photos demo" ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Create a public demo 621332242  
632253073 https://github.com/simonw/datasette/issues/744#issuecomment-632253073 https://api.github.com/repos/simonw/datasette/issues/744 MDEyOklzc3VlQ29tbWVudDYzMjI1MzA3Mw== simonw 9599 2020-05-21T17:54:55Z 2020-05-21T17:54:55Z OWNER

I think this is the fix! I just landed it in master.

@aborruso you can install Datasette master to test it out like this:

pip install https://github.com/simonw/datasette/archive/cee671a58f417f827d1735b1abaa40716534ea67.zip
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
link_or_copy_directory() error - Invalid cross-device link 608058890  
632237195 https://github.com/simonw/datasette/issues/744#issuecomment-632237195 https://api.github.com/repos/simonw/datasette/issues/744 MDEyOklzc3VlQ29tbWVudDYzMjIzNzE5NQ== simonw 9599 2020-05-21T17:23:39Z 2020-05-21T17:23:48Z OWNER

Actually maybe the answer here is to use dirs_exist_ok=True when calling shutil.copytree.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
link_or_copy_directory() error - Invalid cross-device link 608058890  
632233393 https://github.com/simonw/datasette/issues/744#issuecomment-632233393 https://api.github.com/repos/simonw/datasette/issues/744 MDEyOklzc3VlQ29tbWVudDYzMjIzMzM5Mw== simonw 9599 2020-05-21T17:16:15Z 2020-05-21T17:17:43Z OWNER

I just hit this bug myself, or at least a variant of it!

https://github.com/simonw/museums/runs/697063068?check_suite_focus=true

2020-05-21T17:14:02.2596471Z Traceback (most recent call last): 2020-05-21T17:14:02.2599146Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/site-packages/datasette/utils/__init__.py", line 605, in link_or_copy_directory 2020-05-21T17:14:02.2599861Z shutil.copytree(src, dst, copy_function=os.link) 2020-05-21T17:14:02.2600377Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/shutil.py", line 554, in copytree 2020-05-21T17:14:02.2600786Z return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks, 2020-05-21T17:14:02.2601196Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/shutil.py", line 510, in _copytree 2020-05-21T17:14:02.2601580Z raise Error(errors) 2020-05-21T17:14:02.2604565Z shutil.Error: [('/home/runner/work/museums/museums/templates/row-browse-museums.html', '/tmp/tmpq47xi96y/datasette/templates/row-browse-museums.html', "[Errno 18] Invalid cross-device link: '/home/runner/work/museums/museums/templates/row-browse-museums.html' -> '/tmp/tmpq47xi96y/datasette/templates/row-browse-museums.html'"), ('/home/runner/work/museums/museums/templates/index.html', '/tmp/tmpq47xi96y/datasette/templates/index.html', "[Errno 18] Invalid cross-device link: '/home/runner/work/museums/museums/templates/index.html' -> '/tmp/tmpq47xi96y/datasette/templates/index.html'"), ('/home/runner/work/museums/museums/templates/query-browse-search.html', '/tmp/tmpq47xi96y/datasette/templates/query-browse-search.html', "[Errno 18] Invalid cross-device link: '/home/runner/work/museums/museums/templates/query-browse-search.html' -> '/tmp/tmpq47xi96y/datasette/templates/query-browse-search.html'"), ('/home/runner/work/museums/museums/templates/_analytics.html', '/tmp/tmpq47xi96y/datasette/templates/_analytics.html', "[Errno 18] Invalid cross-device link: '/home/runner/work/museums/museums/templates/_analytics.html' -> '/tmp/tmpq47xi96y/datasette/templates/_analytics.html'"), ('/home/runner/work/museums/museums/templates/_museum_card.html', '/tmp/tmpq47xi96y/datasette/templates/_museum_card.html', "[Errno 18] Invalid cross-device link: '/home/runner/work/museums/museums/templates/_museum_card.html' -> '/tmp/tmpq47xi96y/datasette/templates/_museum_card.html'"), ('/home/runner/work/museums/museums/templates/pages/about.html', '/tmp/tmpq47xi96y/datasette/templates/pages/about.html', "[Errno 18] Invalid cross-device link: '/home/runner/work/museums/museums/templates/pages/about.html' -> '/tmp/tmpq47xi96y/datasette/templates/pages/about.html'"), ('/home/runner/work/museums/museums/templates/pages/map.html', '/tmp/tmpq47xi96y/datasette/templates/pages/map.html', "[Errno 18] Invalid cross-device link: '/home/runner/work/museums/museums/templates/pages/map.html' -> '/tmp/tmpq47xi96y/datasette/templates/pages/map.html'")] 2020-05-21T17:14:02.2605437Z 2020-05-21T17:14:02.2605797Z During handling of the above exception, another exception occurred: 2020-05-21T17:14:02.2606102Z 2020-05-21T17:14:02.2606423Z Traceback (most recent call last): 2020-05-21T17:14:02.2606817Z File "/opt/hostedtoolcache/Python/3.8.3/x64/bin/datasette", line 8, in <module> 2020-05-21T17:14:02.2607189Z sys.exit(cli()) 2020-05-21T17:14:02.2607907Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/site-packages/click/core.py", line 829, in __call__ 2020-05-21T17:14:02.2608347Z return self.main(*args, **kwargs) 2020-05-21T17:14:02.2609024Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/site-packages/click/core.py", line 782, in main 2020-05-21T17:14:02.2609451Z rv = self.invoke(ctx) 2020-05-21T17:14:02.2610116Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/site-packages/click/core.py", line 1259, in invoke 2020-05-21T17:14:02.2610550Z return _process_result(sub_ctx.command.invoke(sub_ctx)) 2020-05-21T17:14:02.2611451Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/site-packages/click/core.py", line 1259, in invoke 2020-05-21T17:14:02.2611989Z return _process_result(sub_ctx.command.invoke(sub_ctx)) 2020-05-21T17:14:02.2612682Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/site-packages/click/core.py", line 1066, in invoke 2020-05-21T17:14:02.2613117Z return ctx.invoke(self.callback, **ctx.params) 2020-05-21T17:14:02.2613801Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/site-packages/click/core.py", line 610, in invoke 2020-05-21T17:14:02.2614235Z return callback(*args, **kwargs) 2020-05-21T17:14:02.2614946Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/site-packages/datasette/publish/cloudrun.py", line 111, in cloudrun 2020-05-21T17:14:02.2615371Z with temporary_docker_directory( 2020-05-21T17:14:02.2615769Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/contextlib.py", line 113, in __enter__ 2020-05-21T17:14:02.2616135Z return next(self.gen) 2020-05-21T17:14:02.2616957Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/site-packages/datasette/utils/__init__.py", line 392, in temporary_docker_directory 2020-05-21T17:14:02.2617403Z link_or_copy_directory( 2020-05-21T17:14:02.2618298Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/site-packages/datasette/utils/__init__.py", line 607, in link_or_copy_directory 2020-05-21T17:14:02.2619270Z shutil.copytree(src, dst) 2020-05-21T17:14:02.2619872Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/shutil.py", line 554, in copytree 2020-05-21T17:14:02.2622179Z return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks, 2020-05-21T17:14:02.2622609Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/shutil.py", line 455, in _copytree 2020-05-21T17:14:02.2622878Z os.makedirs(dst, exist_ok=dirs_exist_ok) 2020-05-21T17:14:02.2623157Z File "/opt/hostedtoolcache/Python/3.8.3/x64/lib/python3.8/os.py", line 223, in makedirs 2020-05-21T17:14:02.2623405Z mkdir(name, mode) 2020-05-21T17:14:02.2623978Z FileExistsError: [Errno 17] File exists: '/tmp/tmpq47xi96y/datasette/templates'

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
link_or_copy_directory() error - Invalid cross-device link 608058890  
631251707 https://github.com/dogsheep/dogsheep-photos/issues/25#issuecomment-631251707 https://api.github.com/repos/dogsheep/dogsheep-photos/issues/25 MDEyOklzc3VlQ29tbWVudDYzMTI1MTcwNw== simonw 9599 2020-05-20T05:49:27Z 2020-05-21T15:58:42Z MEMBER

Renaming this demo to dogsheep-photos.dogsheep.net

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Create a public demo 621332242  
631127454 https://github.com/dogsheep/dogsheep-photos/issues/25#issuecomment-631127454 https://api.github.com/repos/dogsheep/dogsheep-photos/issues/25 MDEyOklzc3VlQ29tbWVudDYzMTEyNzQ1NA== simonw 9599 2020-05-19T22:48:00Z 2020-05-21T15:58:32Z MEMBER

I built #23 to help with this.

$ dogsheep-photos create-subset photos.db public.db \
    "select sha256 from apple_photos where albums like '%Public%'"

And publish with Vercel:

$ datasette publish now public.db --project dogsheep-photos \
    --about=dogsheep/dogsheep-photos \
    --about_url="https://github.com/dogsheep/dogsheep-photos" \
    --install=datasette-json-html \
    --install=datasette-cluster-map
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Create a public demo 621332242  

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 558.894ms · About: github-to-sqlite