home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 1436755752 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • zmoon 3
  • headtr1ck 3

author_association 2

  • COLLABORATOR 3
  • CONTRIBUTOR 3

issue 1

  • mypy complaint about `.to_netcdf` `encoding` · 6 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1311934208 https://github.com/pydata/xarray/issues/7258#issuecomment-1311934208 https://api.github.com/repos/pydata/xarray/issues/7258 IC_kwDOAMm_X85OMocA zmoon 15079414 2022-11-11T16:43:46Z 2022-11-11T16:43:46Z CONTRIBUTOR

Ah, I thought it might be something like that when you mentioned invariance earlier. Thanks!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  mypy complaint about `.to_netcdf` `encoding` 1436755752
1311932036 https://github.com/pydata/xarray/issues/7258#issuecomment-1311932036 https://api.github.com/repos/pydata/xarray/issues/7258 IC_kwDOAMm_X85OMn6E headtr1ck 43316012 2022-11-11T16:41:10Z 2022-11-11T16:41:10Z COLLABORATOR

The problem is that a dict is invariant in it's keys so your variable is a dict[str, Any] but the function was typed as dict[Hashable, Any]. Now the problem is that a dict is mutable and the function could modify the dict, but it might write non-str keys, which you might not expect.

Why it does not work with a Mapping that in principle is read-only, I don't know.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  mypy complaint about `.to_netcdf` `encoding` 1436755752
1311928206 https://github.com/pydata/xarray/issues/7258#issuecomment-1311928206 https://api.github.com/repos/pydata/xarray/issues/7258 IC_kwDOAMm_X85OMm-O zmoon 15079414 2022-11-11T16:36:47Z 2022-11-11T16:36:47Z CONTRIBUTOR

@headtr1ck would you mind explaining a bit more what the complaint was? I had string keys and str is hashable, so still a bit confused.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  mypy complaint about `.to_netcdf` `encoding` 1436755752
1304594086 https://github.com/pydata/xarray/issues/7258#issuecomment-1304594086 https://api.github.com/repos/pydata/xarray/issues/7258 IC_kwDOAMm_X85Nwoam headtr1ck 43316012 2022-11-05T17:17:34Z 2022-11-05T17:17:34Z COLLABORATOR

I think we have to change the typing to Mapping[Any, Mapping[str, Any] | None

This should be a simple PR, could I interest you in submitting one?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  mypy complaint about `.to_netcdf` `encoding` 1436755752
1304560538 https://github.com/pydata/xarray/issues/7258#issuecomment-1304560538 https://api.github.com/repos/pydata/xarray/issues/7258 IC_kwDOAMm_X85NwgOa zmoon 15079414 2022-11-05T14:48:12Z 2022-11-05T14:58:08Z CONTRIBUTOR

Yes mypy is pleased with encoding: dict[Hashable, dict[str, Any]] (or if pass encoding as dict literal instead of creating a variable beforehand).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  mypy complaint about `.to_netcdf` `encoding` 1436755752
1304445687 https://github.com/pydata/xarray/issues/7258#issuecomment-1304445687 https://api.github.com/repos/pydata/xarray/issues/7258 IC_kwDOAMm_X85NwEL3 headtr1ck 43316012 2022-11-05T08:51:04Z 2022-11-05T08:51:04Z COLLABORATOR

Invariance strikes again...

Could you check if it is fixed if you annotate your dict as dict[typing.Hashable, dict[str, typing.Any]]?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  mypy complaint about `.to_netcdf` `encoding` 1436755752

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,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
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 14.905ms · About: xarray-datasette
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows