home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 565626748 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • shoyer 2
  • max-sixty 2
  • keewis 1

issue 1

  • `where` ignores incorrectly typed arguments · 5 ✖

author_association 1

  • MEMBER 5
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
587149607 https://github.com/pydata/xarray/issues/3770#issuecomment-587149607 https://api.github.com/repos/pydata/xarray/issues/3770 MDEyOklzc3VlQ29tbWVudDU4NzE0OTYwNw== shoyer 1217238 2020-02-17T20:36:37Z 2020-02-17T20:36:37Z MEMBER

I'd be OK with callable support in where() and other methods, as long as we have a clear policy about what methods should/will support it.

On Mon, Feb 17, 2020 at 11:29 AM keewis notifications@github.com wrote:

The docs https://docs.python.org/3/library/stdtypes.html#truth-value-testing state that the builtin bool returns True for all objects unless bool is defined or len returns 0 (function objects don't define either so they use the fallback). I'm not sure why, but I suspect it is the way it is to make

if obj: ...

equivalent to

if obj is not None: ...

That said I really like the callable support of pandas (e.g. Series.where), so maybe we should add that too?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/issues/3770?email_source=notifications&email_token=AAJJFVRYEDNJXFBFUBOKMI3RDLQRPA5CNFSM4KVTARTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL7OM5Y#issuecomment-587130487, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJJFVQWSRLFT7AXVGGWWULRDLQRPANCNFSM4KVTARTA .

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `where` ignores incorrectly typed arguments 565626748
587130487 https://github.com/pydata/xarray/issues/3770#issuecomment-587130487 https://api.github.com/repos/pydata/xarray/issues/3770 MDEyOklzc3VlQ29tbWVudDU4NzEzMDQ4Nw== keewis 14808389 2020-02-17T19:29:27Z 2020-02-17T19:29:27Z MEMBER

The docs state that the builtin bool returns True for all objects unless __bool__ is defined or __len__ returns 0 (function objects don't define either so they use the fallback). I'm not sure why, but I suspect it is the way it is to make python if obj: ... equivalent to python if obj is not None: ...

That said I really like the callable support of pandas (e.g. Series.where), so maybe we should add that too?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `where` ignores incorrectly typed arguments 565626748
586655557 https://github.com/pydata/xarray/issues/3770#issuecomment-586655557 https://api.github.com/repos/pydata/xarray/issues/3770 MDEyOklzc3VlQ29tbWVudDU4NjY1NTU1Nw== max-sixty 5635139 2020-02-16T00:34:27Z 2020-02-16T00:34:27Z MEMBER

👍

a) should we type check before we pass to numpy? b) should we support single-argument callables?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `where` ignores incorrectly typed arguments 565626748
586653324 https://github.com/pydata/xarray/issues/3770#issuecomment-586653324 https://api.github.com/repos/pydata/xarray/issues/3770 MDEyOklzc3VlQ29tbWVudDU4NjY1MzMyNA== shoyer 1217238 2020-02-16T00:01:54Z 2020-02-16T00:01:54Z MEMBER

This is a NumPy thing, too: python In [6]: np.where(lambda: None, 1, 2) Out[6]: array(1) I think the problem is that functions cast to True with bool.

(I don't really understand why that is the case, but it does seem to be well-established behavior in Python)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `where` ignores incorrectly typed arguments 565626748
586547352 https://github.com/pydata/xarray/issues/3770#issuecomment-586547352 https://api.github.com/repos/pydata/xarray/issues/3770 MDEyOklzc3VlQ29tbWVudDU4NjU0NzM1Mg== max-sixty 5635139 2020-02-15T03:07:14Z 2020-02-15T03:07:14Z MEMBER

Would we want callables to be acceptable arguments to functions like where, assign, loc?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `where` ignores incorrectly typed arguments 565626748

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 966.47ms · About: xarray-datasette