home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

16 rows where author_association = "OWNER" and "updated_at" is on date 2019-05-03 sorted by updated_at descending

✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 9

  • "datasette publish cloudrun" command to publish to Google Cloud Run 4
  • Define mechanism for plugins to return structured data 3
  • Mark codemirror files as vendored 2
  • Suppress rendering of binary data 2
  • Faceted browse against a JSON list of tags 1
  • New design for facet abstraction, including querystring and metadata.json 1
  • Refactor facets to a class and new plugin, refs #427 1
  • Use dist: xenial and python: 3.7 on Travis 1
  • _facet_array should work against views 1

user 1

  • simonw 16

author_association 1

  • OWNER · 16 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
489250828 https://github.com/simonw/datasette/pull/434#issuecomment-489250828 https://api.github.com/repos/simonw/datasette/issues/434 MDEyOklzc3VlQ29tbWVudDQ4OTI1MDgyOA== simonw 9599 2019-05-03T21:50:44Z 2019-05-03T21:50:44Z OWNER

Since there's a useful error message I'm OK with revisiting this in a few weeks to see if they change the CLI tool.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
"datasette publish cloudrun" command to publish to Google Cloud Run 434321685  
489241377 https://github.com/simonw/datasette/pull/367#issuecomment-489241377 https://api.github.com/repos/simonw/datasette/issues/367 MDEyOklzc3VlQ29tbWVudDQ4OTI0MTM3Nw== simonw 9599 2019-05-03T21:12:09Z 2019-05-03T21:12:09Z OWNER

Before applying this fix, GitHub showed the following statistics:

Python 50.1% JavaScript 46.0% HTML 3.0% Other 0.9%

Afterwards, it shows:

Python 92.8% HTML 5.5% CSS 1.3% Dockerfile 0.4%
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mark codemirror files as vendored 374675798  
489240874 https://github.com/simonw/datasette/pull/367#issuecomment-489240874 https://api.github.com/repos/simonw/datasette/issues/367 MDEyOklzc3VlQ29tbWVudDQ4OTI0MDg3NA== simonw 9599 2019-05-03T21:10:13Z 2019-05-03T21:10:13Z OWNER

This is a neat fix, thanks!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mark codemirror files as vendored 374675798  
489240609 https://github.com/simonw/datasette/issues/448#issuecomment-489240609 https://api.github.com/repos/simonw/datasette/issues/448 MDEyOklzc3VlQ29tbWVudDQ4OTI0MDYwOQ== simonw 9599 2019-05-03T21:09:13Z 2019-05-03T21:09:13Z OWNER

It may be that some facet implementations (ArrayFacet in this case) need a way to detect if they are supported by the thing they are running against (must be a rowid table in this case) and avoid suggesting themselves if they are not compatible. This may require a change to the information we make available to the suggest() method (information passed to the Facet class constructor).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
_facet_array should work against views 440222719  
489209255 https://github.com/simonw/datasette/issues/446#issuecomment-489209255 https://api.github.com/repos/simonw/datasette/issues/446 MDEyOklzc3VlQ29tbWVudDQ4OTIwOTI1NQ== simonw 9599 2019-05-03T19:15:23Z 2019-05-03T19:16:34Z OWNER

The register_output_renderer() hook currently returns a dictionary with body, content_type and status_code keys but each of these keys are optionaly. I'm tempted to make all three required to better fit this model - @russss any objections?

Alternative would be to support default values for properties of the DataSpec subclass - maybe:

__defaults__ = {"body": "", "content_type": "text/plain", "status_code": 200}

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Define mechanism for plugins to return structured data 440134714  
489204605 https://github.com/simonw/datasette/issues/446#issuecomment-489204605 https://api.github.com/repos/simonw/datasette/issues/446 MDEyOklzc3VlQ29tbWVudDQ4OTIwNDYwNQ== simonw 9599 2019-05-03T18:59:51Z 2019-05-03T18:59:59Z OWNER

Potential design:

```python from collections import OrderedDict

class DataSpec: slots = []

def __init__(self, **kwargs):
    if list(kwargs.keys()) != self.__slots__:
        raise TypeError(
            "{}() has required arguments {} (got {})".format(
                self.__class__.__name__, self.__slots__, list(kwargs.keys())
            )
        )
    for key in self.__slots__:
        setattr(self, key, kwargs[key])

def __repr__(self):
    return "<{} {}>".format(self.__class__.__name__, dict(self.as_dict()))

def as_dict(self):
    return OrderedDict([(key, getattr(self, key)) for key in self.__slots__])

class Output(DataSpec): slots = ["body", "content_type", "status_code"] ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Define mechanism for plugins to return structured data 440134714  
489194450 https://github.com/simonw/datasette/pull/442#issuecomment-489194450 https://api.github.com/repos/simonw/datasette/issues/442 MDEyOklzc3VlQ29tbWVudDQ4OTE5NDQ1MA== simonw 9599 2019-05-03T18:26:48Z 2019-05-03T18:26:48Z OWNER

Demo here: https://latest.datasette.io/fixtures/binary_data

I slightly tweaked the copy:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Suppress rendering of binary data 438450757  
489190440 https://github.com/simonw/datasette/pull/447#issuecomment-489190440 https://api.github.com/repos/simonw/datasette/issues/447 MDEyOklzc3VlQ29tbWVudDQ4OTE5MDQ0MA== simonw 9599 2019-05-03T18:13:56Z 2019-05-03T18:13:56Z OWNER

This appears to fix a very weird error we were getting just on Python 3.7-dev: https://travis-ci.org/simonw/datasette/jobs/527858613

That weird error boiled down to count being None:

``` { "columns": ["pk", "distance", "frequency"], "name": "units", "count": 3, "hidden": False, "foreign_keys": {"incoming": [], "outgoing": []}, "fts_table": None, "primary_keys": ["pk"], }

compared to:

{ "name": "units", "columns": ["pk", "distance", "frequency"], "primary_keys": ["pk"], "count": None, "hidden": False, "fts_table": None, "foreign_keys": {"incoming": [], "outgoing": []}, } ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Use dist: xenial and python: 3.7 on Travis 440159137  
489167692 https://github.com/simonw/datasette/issues/446#issuecomment-489167692 https://api.github.com/repos/simonw/datasette/issues/446 MDEyOklzc3VlQ29tbWVudDQ4OTE2NzY5Mg== simonw 9599 2019-05-03T17:02:24Z 2019-05-03T17:02:24Z OWNER

I looked at using namedtuples for this but hey have one major constraint: there isn't a clean way to convert them to dictionary-style JSON: https://bugs.python.org/issue30343

So something that uses a class which knows how to be rendered as JSON would be a better fit.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Define mechanism for plugins to return structured data 440134714  
489162365 https://github.com/simonw/datasette/pull/442#issuecomment-489162365 https://api.github.com/repos/simonw/datasette/issues/442 MDEyOklzc3VlQ29tbWVudDQ4OTE2MjM2NQ== simonw 9599 2019-05-03T16:44:29Z 2019-05-03T16:44:29Z OWNER

I'm going to merge this and add a unit test.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Suppress rendering of binary data 438450757  
489154360 https://github.com/simonw/datasette/pull/434#issuecomment-489154360 https://api.github.com/repos/simonw/datasette/issues/434 MDEyOklzc3VlQ29tbWVudDQ4OTE1NDM2MA== simonw 9599 2019-05-03T16:18:18Z 2019-05-03T16:18:18Z OWNER

Documentation is now available here: https://datasette.readthedocs.io/en/latest/publish.html#publishing-to-google-cloud-run

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
"datasette publish cloudrun" command to publish to Google Cloud Run 434321685  
489138554 https://github.com/simonw/datasette/pull/434#issuecomment-489138554 https://api.github.com/repos/simonw/datasette/issues/434 MDEyOklzc3VlQ29tbWVudDQ4OTEzODU1NA== simonw 9599 2019-05-03T15:36:48Z 2019-05-03T15:36:48Z OWNER

Here's my first working deployment: https://datasette-j7hipcg4aq-uc.a.run.app/fixtures-c35b6a5/facetable?_facet_array=tags

I deployed it using this:

datasette publish cloudrun fixtures.db --branch=master

The second time I ran the command I got an error:

ERROR: (gcloud.beta.run.deploy) Deployment endpoint was not found. Perhaps the
provided region was invalid. Set the `run/region` property to a valid region and
retry. Ex: `gcloud config set run/region us-central1`

So I ran the command it suggested and then everything worked:

gcloud config set run/region us-central1
datasette publish cloudrun fixtures.db --branch=master
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
"datasette publish cloudrun" command to publish to Google Cloud Run 434321685  
489104146 https://github.com/simonw/datasette/pull/434#issuecomment-489104146 https://api.github.com/repos/simonw/datasette/issues/434 MDEyOklzc3VlQ29tbWVudDQ4OTEwNDE0Ng== simonw 9599 2019-05-03T13:56:45Z 2019-05-03T13:56:45Z OWNER

This is amazing - works an absolute treat. Thank you very much!

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
"datasette publish cloudrun" command to publish to Google Cloud Run 434321685  
489076725 https://github.com/simonw/datasette/issues/359#issuecomment-489076725 https://api.github.com/repos/simonw/datasette/issues/359 MDEyOklzc3VlQ29tbWVudDQ4OTA3NjcyNQ== simonw 9599 2019-05-03T12:20:38Z 2019-05-03T12:20:38Z OWNER

Demo: https://latest.datasette.io/fixtures/facetable?_facet_array=tags#facet-tags

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Faceted browse against a JSON list of tags 349827640  
488564761 https://github.com/simonw/datasette/issues/427#issuecomment-488564761 https://api.github.com/repos/simonw/datasette/issues/427 MDEyOklzc3VlQ29tbWVudDQ4ODU2NDc2MQ== simonw 9599 2019-05-02T06:24:49Z 2019-05-03T00:07:16Z OWNER

https://github.com/simonw/datasette/compare/facet-refactor-2 is almost ready to merge now. The remaining things to do are listed as TODOs there:

  • [x] Ensure facet is not suggested if it is already active
  • [x] Don't allow facets to be hidden if they were configured in metadata.json
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
New design for facet abstraction, including querystring and metadata.json 431800286  
488874364 https://github.com/simonw/datasette/pull/432#issuecomment-488874364 https://api.github.com/repos/simonw/datasette/issues/432 MDEyOklzc3VlQ29tbWVudDQ4ODg3NDM2NA== simonw 9599 2019-05-03T00:04:23Z 2019-05-03T00:04:23Z OWNER

Abandoning this in favour of #445 - which contains the code from this branch but updated to incorporate recent changes in master.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Refactor facets to a class and new plugin, refs #427 432893491  

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