home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where author_association = "CONTRIBUTOR" and issue = 1458347938 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

  • weiji14 2
  • martindurant 1

issue 1

  • Reset file pointer to 0 when reading file stream · 3 ✖

author_association 1

  • CONTRIBUTOR · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1330782936 https://github.com/pydata/xarray/pull/7304#issuecomment-1330782936 https://api.github.com/repos/pydata/xarray/issues/7304 IC_kwDOAMm_X85PUiLY weiji14 23487320 2022-11-29T15:00:21Z 2022-11-29T15:09:15Z CONTRIBUTOR

It loos reasonable to me. I'm not sure if the warning is needed or not - we don't expect anyone to see it, or if they do, necessarily do anything about it. It's not unusual for code interacting with a file-like object to move the file pointer.

Hmm, in that case, I'm leaning towards removing the warning. The file pointer is reset anyway after reading the magic byte number, and that hasn't caused any issues (as mentioned in https://github.com/pydata/xarray/issues/6813#issuecomment-1205503288), so it should be more or less safe. Let me push another commit. Edit: done at 929cb62977d630a00ace9747bc86066555b83d0d.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Reset file pointer to 0 when reading file stream 1458347938
1330736962 https://github.com/pydata/xarray/pull/7304#issuecomment-1330736962 https://api.github.com/repos/pydata/xarray/issues/7304 IC_kwDOAMm_X85PUW9C martindurant 6042212 2022-11-29T14:30:43Z 2022-11-29T14:30:43Z CONTRIBUTOR

It loos reasonable to me. I'm not sure if the warning is needed or not - we don't expect anyone to see it, or if they do, necessarily do anything about it. It's not unusual for code interacting with a file-like object to move the file pointer.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Reset file pointer to 0 when reading file stream 1458347938
1322461240 https://github.com/pydata/xarray/pull/7304#issuecomment-1322461240 https://api.github.com/repos/pydata/xarray/issues/7304 IC_kwDOAMm_X85O0yg4 weiji14 23487320 2022-11-21T18:10:20Z 2022-11-21T18:13:07Z CONTRIBUTOR

Traceback from the 2 test failures at https://github.com/pydata/xarray/actions/runs/3516849430/jobs/5893926099#step:9:252

```python-traceback =================================== FAILURES =================================== ____ TestH5NetCDFFileObject.test_open_twice ______ [gw2] linux -- Python 3.10.7 /home/runner/micromamba-root/envs/xarray-tests/bin/python

self = <xarray.tests.test_backends.TestH5NetCDFFileObject object at 0x7f211de81e40>

def test_open_twice(self) -> None:
    expected = create_test_data()
    expected.attrs["foo"] = "bar"
  with pytest.raises(ValueError, match=r"read/write pointer not at the start"):

E Failed: DID NOT RAISE <class 'ValueError'>

/home/runner/work/xarray/xarray/xarray/tests/test_backends.py:3034: Failed ___ TestH5NetCDFFileObject.test_open_fileobj _____ [gw2] linux -- Python 3.10.7 /home/runner/micromamba-root/envs/xarray-tests/bin/python

self = <xarray.tests.test_backends.TestH5NetCDFFileObject object at 0x7f211de82530>

@requires_scipy
def test_open_fileobj(self) -> None:
    # open in-memory datasets instead of local file paths
    expected = create_test_data().drop_vars("dim3")
    expected.attrs["foo"] = "bar"
    with create_tmp_file() as tmp_file:
        expected.to_netcdf(tmp_file, engine="h5netcdf")

        with open(tmp_file, "rb") as f:
            with open_dataset(f, engine="h5netcdf") as actual:
                assert_identical(expected, actual)

            f.seek(0)
            with open_dataset(f) as actual:
                assert_identical(expected, actual)

            f.seek(0)
            with BytesIO(f.read()) as bio:
                with open_dataset(bio, engine="h5netcdf") as actual:
                    assert_identical(expected, actual)

            f.seek(0)
            with pytest.raises(TypeError, match="not a valid NetCDF 3"):
                open_dataset(f, engine="scipy")

        # TODO: this additional open is required since scipy seems to close the file
        # when it fails on the TypeError (though didn't when we used
        # `raises_regex`?). Ref https://github.com/pydata/xarray/pull/5191
        with open(tmp_file, "rb") as f:
            f.seek(8)
            with pytest.raises(
                ValueError,
                match="match in any of xarray's currently installed IO",
            ):
              with pytest.warns(
                    RuntimeWarning,
                    match=re.escape("'h5netcdf' fails while guessing"),
                ):

E Failed: DID NOT WARN. No warnings of type (<class 'RuntimeWarning'>,) matching the regex were emitted. E Regex: 'h5netcdf'\ fails\ while\ guessing E Emitted warnings: [ UserWarning('cannot guess the engine, file-like object read/write pointer not at the start of the file, so resetting file pointer to zero. If this does not work, please close and reopen, or use a context manager'), E RuntimeWarning("deallocating CachingFileManager(<class 'h5netcdf.core.File'>, <_io.BufferedReader name='/tmp/tmpoxdfl12i/temp-720.nc'>, mode='r', kwargs={'invalid_netcdf': None, 'decode_vlen_strings': True}, manager_id='b62ec6c8-b328-409c-bc5d-bbab265bea51'), but file is not already closed. This may indicate a bug.")]

/home/runner/work/xarray/xarray/xarray/tests/test_backends.py:3076: Failed =========================== short test summary info ============================ FAILED xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_open_twice - Failed: DID NOT RAISE <class 'ValueError'> FAILED xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_open_fileobj - Failed: DID NOT WARN. No warnings of type (<class 'RuntimeWarning'>,) matching the regex were emitted. Regex: 'h5netcdf'\ fails\ while\ guessing Emitted warnings: [ UserWarning('cannot guess the engine, file-like object read/write pointer not at the start of the file, so resetting file pointer to zero. If this does not work, please close and reopen, or use a context manager'), RuntimeWarning("deallocating CachingFileManager(<class 'h5netcdf.core.File'>, <_io.BufferedReader name='/tmp/tmpoxdfl12i/temp-720.nc'>, mode='r', kwargs={'invalid_netcdf': None, 'decode_vlen_strings': True}, manager_id='b62ec6c8-b328-409c-bc5d-bbab265bea51'), but file is not already closed. This may indicate a bug.")] = 2 failed, 14608 passed, 1190 skipped, 203 xfailed, 73 xpassed, 54 warnings in 581.98s (0:09:41) = ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Reset file pointer to 0 when reading file stream 1458347938

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