Skip to content

Updated hash key generation to handle missing encoding dtype. #482

Updated hash key generation to handle missing encoding dtype.

Updated hash key generation to handle missing encoding dtype. #482

GitHub Actions / JUnit Test Report - python 3.10, pinned dependencies failed Dec 12, 2024 in 0s

398 tests run, 395 passed, 1 skipped, 2 failed.

Annotations

Check failure on line 215 in tests/operations/test_cache.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report - python 3.10, pinned dependencies

test_cache.test_cache_key_with_multifile_dataset_ugrid_mesh2d

FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/emsarray/emsarray/tests/datasets/multiple_dataset/ugrid_mesh2d/ugrid_mesh2d_2024-01-01.nc'
Raw output
self = CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/home/runner/work/emsarray/emsarray/tests/datasets/multiple_da...r': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='45435b74-2159-4911-9736-8aee1258f1da')
needs_lock = True

    def _acquire_with_cache_info(self, needs_lock=True):
        """Acquire a file, returning the file and whether it was cached."""
        with self._optional_lock(needs_lock):
            try:
>               file = self._cache[self._key]

/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/file_manager.py:211: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.backends.lru_cache.LRUCache object at 0x7f627a8df500>
key = [<class 'netCDF4._netCDF4.Dataset'>, ('/home/runner/work/emsarray/emsarray/tests/datasets/multiple_dataset/ugrid_mesh2...obber', True), ('diskless', False), ('format', 'NETCDF4'), ('persist', False)), '45435b74-2159-4911-9736-8aee1258f1da']

    def __getitem__(self, key: K) -> V:
        # record recent use of the key by moving it to the front of the list
        with self._lock:
>           value = self._cache[key]
E           KeyError: [<class 'netCDF4._netCDF4.Dataset'>, ('/home/runner/work/emsarray/emsarray/tests/datasets/multiple_dataset/ugrid_mesh2d/ugrid_mesh2d_2024-01-01.nc',), 'r', (('clobber', True), ('diskless', False), ('format', 'NETCDF4'), ('persist', False)), '45435b74-2159-4911-9736-8aee1258f1da']

/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/lru_cache.py:56: KeyError

During handling of the above exception, another exception occurred:

datasets = PosixPath('/home/runner/work/emsarray/emsarray/tests/datasets')

    def test_cache_key_with_multifile_dataset_ugrid_mesh2d(datasets: pathlib.Path):
    
        ugrid_path1 = datasets / 'multiple_dataset/ugrid_mesh2d/ugrid_mesh2d_2024-01-01.nc'
        ugrid_path2 = datasets / 'multiple_dataset/ugrid_mesh2d/ugrid_mesh2d_2024-01-02.nc'
    
        dataset_paths = [ugrid_path1, ugrid_path2]
    
>       multifile_dataset = xarray.open_mfdataset(dataset_paths, data_vars=['values'])

tests/operations/test_cache.py:215: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/api.py:1054: in open_mfdataset
    datasets = [open_(p, **open_kwargs) for p in paths]
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/api.py:1054: in <listcomp>
    datasets = [open_(p, **open_kwargs) for p in paths]
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/api.py:571: in open_dataset
    backend_ds = backend.open_dataset(
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:645: in open_dataset
    store = NetCDF4DataStore.open(
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:408: in open
    return cls(manager, group=group, mode=mode, lock=lock, autoclose=autoclose)
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:355: in __init__
    self.format = self.ds.data_model
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:417: in ds
    return self._acquire()
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:411: in _acquire
    with self._manager.acquire_context(needs_lock) as root:
/usr/share/miniconda/envs/test/lib/python3.10/contextlib.py:135: in __enter__
    return next(self.gen)
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/file_manager.py:199: in acquire_context
    file, cached = self._acquire_with_cache_info(needs_lock)
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/file_manager.py:217: in _acquire_with_cache_info
    file = self._opener(*self._args, **kwargs)
src/netCDF4/_netCDF4.pyx:2470: in netCDF4._netCDF4.Dataset.__init__
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/emsarray/emsarray/tests/datasets/multiple_dataset/ugrid_mesh2d/ugrid_mesh2d_2024-01-01.nc'

src/netCDF4/_netCDF4.pyx:2107: FileNotFoundError

Check failure on line 233 in tests/operations/test_cache.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report - python 3.10, pinned dependencies

test_cache.test_cache_key_with_multifile_dataset_cfgrid2d

FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/emsarray/emsarray/tests/datasets/multiple_dataset/cfgrid2d/cfgrid2d_2024-01-01.nc'
Raw output
self = CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/home/runner/work/emsarray/emsarray/tests/datasets/multiple_da...r': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='a472fa40-6764-4d71-b8c8-921ef0dcefe3')
needs_lock = True

    def _acquire_with_cache_info(self, needs_lock=True):
        """Acquire a file, returning the file and whether it was cached."""
        with self._optional_lock(needs_lock):
            try:
>               file = self._cache[self._key]

/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/file_manager.py:211: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <xarray.backends.lru_cache.LRUCache object at 0x7f627a8df500>
key = [<class 'netCDF4._netCDF4.Dataset'>, ('/home/runner/work/emsarray/emsarray/tests/datasets/multiple_dataset/cfgrid2d/cf...obber', True), ('diskless', False), ('format', 'NETCDF4'), ('persist', False)), 'a472fa40-6764-4d71-b8c8-921ef0dcefe3']

    def __getitem__(self, key: K) -> V:
        # record recent use of the key by moving it to the front of the list
        with self._lock:
>           value = self._cache[key]
E           KeyError: [<class 'netCDF4._netCDF4.Dataset'>, ('/home/runner/work/emsarray/emsarray/tests/datasets/multiple_dataset/cfgrid2d/cfgrid2d_2024-01-01.nc',), 'r', (('clobber', True), ('diskless', False), ('format', 'NETCDF4'), ('persist', False)), 'a472fa40-6764-4d71-b8c8-921ef0dcefe3']

/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/lru_cache.py:56: KeyError

During handling of the above exception, another exception occurred:

datasets = PosixPath('/home/runner/work/emsarray/emsarray/tests/datasets')

    def test_cache_key_with_multifile_dataset_cfgrid2d(datasets: pathlib.Path):
    
        cfgrid_path1 = datasets / 'multiple_dataset/cfgrid2d/cfgrid2d_2024-01-01.nc'
        cfgrid_path2 = datasets / 'multiple_dataset/cfgrid2d/cfgrid2d_2024-01-02.nc'
    
        dataset_paths = [cfgrid_path1, cfgrid_path2]
    
>       multifile_dataset = xarray.open_mfdataset(dataset_paths, data_vars=['values'])

tests/operations/test_cache.py:233: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/api.py:1054: in open_mfdataset
    datasets = [open_(p, **open_kwargs) for p in paths]
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/api.py:1054: in <listcomp>
    datasets = [open_(p, **open_kwargs) for p in paths]
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/api.py:571: in open_dataset
    backend_ds = backend.open_dataset(
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:645: in open_dataset
    store = NetCDF4DataStore.open(
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:408: in open
    return cls(manager, group=group, mode=mode, lock=lock, autoclose=autoclose)
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:355: in __init__
    self.format = self.ds.data_model
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:417: in ds
    return self._acquire()
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/netCDF4_.py:411: in _acquire
    with self._manager.acquire_context(needs_lock) as root:
/usr/share/miniconda/envs/test/lib/python3.10/contextlib.py:135: in __enter__
    return next(self.gen)
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/file_manager.py:199: in acquire_context
    file, cached = self._acquire_with_cache_info(needs_lock)
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/xarray/backends/file_manager.py:217: in _acquire_with_cache_info
    file = self._opener(*self._args, **kwargs)
src/netCDF4/_netCDF4.pyx:2470: in netCDF4._netCDF4.Dataset.__init__
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/emsarray/emsarray/tests/datasets/multiple_dataset/cfgrid2d/cfgrid2d_2024-01-01.nc'

src/netCDF4/_netCDF4.pyx:2107: FileNotFoundError