home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 1126086052 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

  • mathause 2
  • max-sixty 1
  • keewis 1

issue 1

  • use `warnings.catch_warnings(record=True)` instead of `pytest.warns(None)` · 4 ✖

author_association 1

  • MEMBER 4
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1033137904 https://github.com/pydata/xarray/pull/6251#issuecomment-1033137904 https://api.github.com/repos/pydata/xarray/issues/6251 IC_kwDOAMm_X849lG7w mathause 10194086 2022-02-08T22:46:00Z 2022-02-08T22:46:00Z MEMBER

Nice suggestion. How about assert_no_warnings? Not sure if supress_warnings is a bit over the top?

```python from contextlib import contextmanager import warnings

@contextmanager def assert_no_warnings():

with warnings.catch_warnings(record=True) as record:
    yield
    assert len(record) == 0, "got unexpected warning(s)"

@contextmanager def supress_warnings(*messages):

messages = ("",) if not messages else messages
with warnings.catch_warnings():
    for message in messages:
        warnings.filterwarnings("ignore", message)
    yield

```

```python with supress_warnings(): warnings.warn("test")

with supress_warnings("test"): warnings.warn("test")

with supress_warnings("not test", "something else"): warnings.warn("test")

with assert_no_warnings(): pass

with assert_no_warnings(): warnings.warn("test") ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  use `warnings.catch_warnings(record=True)` instead of `pytest.warns(None)` 1126086052
1033105848 https://github.com/pydata/xarray/pull/6251#issuecomment-1033105848 https://api.github.com/repos/pydata/xarray/issues/6251 IC_kwDOAMm_X849k_G4 keewis 14808389 2022-02-08T22:02:29Z 2022-02-08T22:02:29Z MEMBER

what do you think about adding no_warnings() and suppress_warnings() to xarray.tests.__init__? For those pytest recommends ```python

no_warnings

with warnings.catch_warnings(): warnings.simplefilter("error")

...

or, without the stacktrace

with warnings.catch_warnings(record=True) as record: ...

assert len(record) == 0

or, with pytest.warns()

with pytest.warns() as record: ...

assert len(record) == 0

suppress

with warnings.catch_warnings(): warnings.simplefilter("ignore")

...

```

but those can easily get a name and be a bit easier to read. E.g. for the version of no_warnings() used in this PR: python @contextmanager def no_warnings(): with warnings.catch_warnings(record=True) as record: yield assert len(record) == 0

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  use `warnings.catch_warnings(record=True)` instead of `pytest.warns(None)` 1126086052
1033100203 https://github.com/pydata/xarray/pull/6251#issuecomment-1033100203 https://api.github.com/repos/pydata/xarray/issues/6251 IC_kwDOAMm_X849k9ur max-sixty 5635139 2022-02-08T21:55:45Z 2022-02-08T21:55:45Z MEMBER

Thanks @mathause ! LGTM

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  use `warnings.catch_warnings(record=True)` instead of `pytest.warns(None)` 1126086052
1033075245 https://github.com/pydata/xarray/pull/6251#issuecomment-1033075245 https://api.github.com/repos/pydata/xarray/issues/6251 IC_kwDOAMm_X849k3ot mathause 10194086 2022-02-08T21:23:21Z 2022-02-08T21:23:21Z MEMBER

close/ reopen

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  use `warnings.catch_warnings(record=True)` instead of `pytest.warns(None)` 1126086052

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