home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1322461240

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/7304#issuecomment-1322461240 https://api.github.com/repos/pydata/xarray/issues/7304 1322461240 IC_kwDOAMm_X85O0yg4 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
}
  1458347938
Powered by Datasette · Queries took 77.035ms · About: xarray-datasette