Skip to content

Merge branch 'main' into complex_FillValue

aedad35
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Open

Add complex dtype support to FillValueCoder for Zarr backend #11151

Merge branch 'main' into complex_FillValue
aedad35
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test Results failed Feb 13, 2026 in 0s

45 fail, 2 785 skipped, 21 675 pass in 2h 19m 46s

     14 files  +     14       14 suites  +14   2h 19m 46s ⏱️ + 2h 19m 46s
 24 505 tests + 24 505   21 675 ✅ + 21 675   2 785 💤 + 2 785   45 ❌ + 45 
266 696 runs  +266 696  225 669 ✅ +225 669  40 666 💤 +40 666  361 ❌ +361 

Results for commit aedad35. ± Comparison against earlier commit 9322698.

Annotations

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_mask_and_scale[3-dtype0-create_unsigned_masked_scaled_data-create_encoded_unsigned_masked_scaled_data] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cf9900>
decoded_fn = <function create_unsigned_masked_scaled_data at 0x7f9bb77ad580>
encoded_fn = <function create_encoded_unsigned_masked_scaled_data at 0x7f9bb77ad620>
dtype = dtype('float64')

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        #x1B[33m"#x1B[39;49;00m#x1B[33mdecoded_fn, encoded_fn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                create_bad_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_bad_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mBad _Unsigned attribute.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (create_masked_and_scaled_data, create_encoded_masked_and_scaled_data),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat64#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_mask_and_scale#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, decoded_fn, encoded_fn, dtype) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mhasattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr_version#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[95mand#x1B[39;49;00m dtype == np.float32:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32 will be treated as float64 in zarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        decoded = decoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        encoded = encoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m decoded[#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].encoding[#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] == #x1B[33m"#x1B[39;49;00m#x1B[33mu1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            (#x1B[96mself#x1B[39;49;00m.engine == #x1B[33m"#x1B[39;49;00m#x1B[33mnetcdf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[95mor#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format == #x1B[33m"#x1B[39;49;00m#x1B[33mNETCDF4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33muint8 data can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be written to non-NetCDF4 data#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int8(-1)
dtype = dtype('int8')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_mask_and_scale[3-dtype0-create_signed_masked_scaled_data-create_encoded_signed_masked_scaled_data] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cf99a0>
decoded_fn = <function create_signed_masked_scaled_data at 0x7f9bb77ad800>
encoded_fn = <function create_encoded_signed_masked_scaled_data at 0x7f9bb77ad8a0>
dtype = dtype('float64')

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        #x1B[33m"#x1B[39;49;00m#x1B[33mdecoded_fn, encoded_fn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                create_bad_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_bad_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mBad _Unsigned attribute.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (create_masked_and_scaled_data, create_encoded_masked_and_scaled_data),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat64#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_mask_and_scale#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, decoded_fn, encoded_fn, dtype) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mhasattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr_version#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[95mand#x1B[39;49;00m dtype == np.float32:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32 will be treated as float64 in zarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        decoded = decoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        encoded = encoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m decoded[#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].encoding[#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] == #x1B[33m"#x1B[39;49;00m#x1B[33mu1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            (#x1B[96mself#x1B[39;49;00m.engine == #x1B[33m"#x1B[39;49;00m#x1B[33mnetcdf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[95mor#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format == #x1B[33m"#x1B[39;49;00m#x1B[33mNETCDF4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33muint8 data can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be written to non-NetCDF4 data#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int8(-127)
dtype = dtype('int8')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_mask_and_scale[3-dtype0-create_masked_and_scaled_data-create_encoded_masked_and_scaled_data] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cf9a40>
decoded_fn = <function create_masked_and_scaled_data at 0x7f9bb77ad440>
encoded_fn = <function create_encoded_masked_and_scaled_data at 0x7f9bb77ad4e0>
dtype = dtype('float64')

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        #x1B[33m"#x1B[39;49;00m#x1B[33mdecoded_fn, encoded_fn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                create_bad_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_bad_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mBad _Unsigned attribute.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (create_masked_and_scaled_data, create_encoded_masked_and_scaled_data),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat64#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_mask_and_scale#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, decoded_fn, encoded_fn, dtype) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mhasattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr_version#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[95mand#x1B[39;49;00m dtype == np.float32:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32 will be treated as float64 in zarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        decoded = decoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        encoded = encoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m decoded[#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].encoding[#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] == #x1B[33m"#x1B[39;49;00m#x1B[33mu1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            (#x1B[96mself#x1B[39;49;00m.engine == #x1B[33m"#x1B[39;49;00m#x1B[33mnetcdf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[95mor#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format == #x1B[33m"#x1B[39;49;00m#x1B[33mNETCDF4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33muint8 data can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be written to non-NetCDF4 data#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int16(-1)
dtype = dtype('int16')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_unsigned[3-fill_value0-False] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cf9e00>
fill_value = np.int8(-1), exp_fill_warning = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mfill_value#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mexp_fill_warning#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (np.int8(-#x1B[94m1#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (np.uint8(#x1B[94m255#x1B[39;49;00m), #x1B[94mTrue#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (-#x1B[94m1#x1B[39;49;00m, #x1B[94mFalse#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (#x1B[94m255#x1B[39;49;00m, #x1B[94mTrue#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_unsigned#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, fill_value, exp_fill_warning):#x1B[90m#x1B[39;49;00m
        #x1B[37m@contextlib#x1B[39;49;00m.contextmanager#x1B[90m#x1B[39;49;00m
        #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_roundtrip_with_warnings#x1B[39;49;00m(*args, **kwargs):#x1B[90m#x1B[39;49;00m
            is_np2 = module_available(#x1B[33m"#x1B[39;49;00m#x1B[33mnumpy#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, minversion=#x1B[33m"#x1B[39;49;00m#x1B[33m2.0.0.dev0#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m exp_fill_warning #x1B[95mand#x1B[39;49;00m is_np2:#x1B[90m#x1B[39;49;00m
                warn_checker: contextlib.AbstractContextManager = pytest.warns(#x1B[90m#x1B[39;49;00m
                    SerializationWarning,#x1B[90m#x1B[39;49;00m
                    match=#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue attribute can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be represented#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                warn_checker = contextlib.nullcontext()#x1B[90m#x1B[39;49;00m
            #x1B[94mwith#x1B[39;49;00m warn_checker:#x1B[90m#x1B[39;49;00m
                #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(*args, **kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
                    #x1B[94myield#x1B[39;49;00m actual#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# regression/numpy2 test for#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        encoding = {#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: fill_value,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_Unsigned#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mtrue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mi1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
        x = np.array([#x1B[94m0#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m, #x1B[94m127#x1B[39;49;00m, #x1B[94m128#x1B[39;49;00m, #x1B[94m254#x1B[39;49;00m, np.nan], dtype=np.float32)#x1B[90m#x1B[39;49;00m
        decoded = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33mt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, x, {}, encoding)})#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        attributes = {#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: fill_value,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_Unsigned#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mtrue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
        #x1B[90m# Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        sb = np.asarray([#x1B[94m0#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m, #x1B[94m127#x1B[39;49;00m, -#x1B[94m128#x1B[39;49;00m, -#x1B[94m2#x1B[39;49;00m, -#x1B[94m1#x1B[39;49;00m], dtype=#x1B[33m"#x1B[39;49;00m#x1B[33mi1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        encoded = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33mt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, sb, attributes)})#x1B[90m#x1B[39;49;00m
        unsigned_dtype = np.dtype(#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mu#x1B[39;49;00m#x1B[33m{#x1B[39;49;00msb.dtype.itemsize#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m _roundtrip_with_warnings(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1215: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1194: in _roundtrip_with_warnings
    #x1B[0m#x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(*args, **kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int8(-1)
dtype = dtype('int8')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_unsigned[3--1-False] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cf9ef0>
fill_value = -1, exp_fill_warning = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mfill_value#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mexp_fill_warning#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (np.int8(-#x1B[94m1#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (np.uint8(#x1B[94m255#x1B[39;49;00m), #x1B[94mTrue#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (-#x1B[94m1#x1B[39;49;00m, #x1B[94mFalse#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (#x1B[94m255#x1B[39;49;00m, #x1B[94mTrue#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_unsigned#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, fill_value, exp_fill_warning):#x1B[90m#x1B[39;49;00m
        #x1B[37m@contextlib#x1B[39;49;00m.contextmanager#x1B[90m#x1B[39;49;00m
        #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_roundtrip_with_warnings#x1B[39;49;00m(*args, **kwargs):#x1B[90m#x1B[39;49;00m
            is_np2 = module_available(#x1B[33m"#x1B[39;49;00m#x1B[33mnumpy#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, minversion=#x1B[33m"#x1B[39;49;00m#x1B[33m2.0.0.dev0#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m exp_fill_warning #x1B[95mand#x1B[39;49;00m is_np2:#x1B[90m#x1B[39;49;00m
                warn_checker: contextlib.AbstractContextManager = pytest.warns(#x1B[90m#x1B[39;49;00m
                    SerializationWarning,#x1B[90m#x1B[39;49;00m
                    match=#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue attribute can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be represented#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                warn_checker = contextlib.nullcontext()#x1B[90m#x1B[39;49;00m
            #x1B[94mwith#x1B[39;49;00m warn_checker:#x1B[90m#x1B[39;49;00m
                #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(*args, **kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
                    #x1B[94myield#x1B[39;49;00m actual#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# regression/numpy2 test for#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        encoding = {#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: fill_value,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_Unsigned#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mtrue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mi1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
        x = np.array([#x1B[94m0#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m, #x1B[94m127#x1B[39;49;00m, #x1B[94m128#x1B[39;49;00m, #x1B[94m254#x1B[39;49;00m, np.nan], dtype=np.float32)#x1B[90m#x1B[39;49;00m
        decoded = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33mt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, x, {}, encoding)})#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        attributes = {#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: fill_value,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_Unsigned#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mtrue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
        #x1B[90m# Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        sb = np.asarray([#x1B[94m0#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m, #x1B[94m127#x1B[39;49;00m, -#x1B[94m128#x1B[39;49;00m, -#x1B[94m2#x1B[39;49;00m, -#x1B[94m1#x1B[39;49;00m], dtype=#x1B[33m"#x1B[39;49;00m#x1B[33mi1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        encoded = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33mt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, sb, attributes)})#x1B[90m#x1B[39;49;00m
        unsigned_dtype = np.dtype(#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mu#x1B[39;49;00m#x1B[33m{#x1B[39;49;00msb.dtype.itemsize#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m _roundtrip_with_warnings(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1215: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1194: in _roundtrip_with_warnings
    #x1B[0m#x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(*args, **kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int8(-1)
dtype = dtype('int8')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cf9fe0>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_grid_mapping_and_bounds_are_not_coordinates_in_file#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        original = #x1B[96mself#x1B[39;49;00m._create_cf_dataset()#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(original, open_kwargs={#x1B[33m"#x1B[39;49;00m#x1B[33mdecode_coords#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[94mFalse#x1B[39;49;00m}) #x1B[94mas#x1B[39;49;00m ds:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1291: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_coordinate_variables_after_dataset_roundtrip[3] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cfa080>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_coordinate_variables_after_dataset_roundtrip#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        original = #x1B[96mself#x1B[39;49;00m._create_cf_dataset()#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(original, open_kwargs={#x1B[33m"#x1B[39;49;00m#x1B[33mdecode_coords#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mall#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1299: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
 Emitted warnings: [].
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cfa120>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        original = #x1B[96mself#x1B[39;49;00m._create_cf_dataset()#x1B[90m#x1B[39;49;00m
        #x1B[90m# The DataArray roundtrip should have the same warnings as the#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# Dataset, but we already tested for those, so just go for the#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# new warnings.  It would appear that there is no way to tell#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# pytest "This warning and also this warning should both be#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# present".#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# xarray/tests/test_conventions.py::TestCFEncodedDataStore#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# needs the to_dataset. The other backends should be fine#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# without it.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mwith#x1B[39;49;00m pytest.warns(#x1B[90m#x1B[39;49;00m
            #x1B[96mUserWarning#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            match=(#x1B[90m#x1B[39;49;00m
                #x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mVariable#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m(s#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m) referenced in bounds not in variables: #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m[#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33ml(at|ong)itude_bnds#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
>           #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(#x1B[90m#x1B[39;49;00m
                original[#x1B[33m"#x1B[39;49;00m#x1B[33mvariable#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].to_dataset(), open_kwargs={#x1B[33m"#x1B[39;49;00m#x1B[33mdecode_coords#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mall#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}#x1B[90m#x1B[39;49;00m
            ) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1331: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

#x1B[33mDuring handling of the above exception, another exception occurred:#x1B[0m

self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cfa120>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        original = #x1B[96mself#x1B[39;49;00m._create_cf_dataset()#x1B[90m#x1B[39;49;00m
        #x1B[90m# The DataArray roundtrip should have the same warnings as the#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# Dataset, but we already tested for those, so just go for the#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# new warnings.  It would appear that there is no way to tell#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# pytest "This warning and also this warning should both be#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# present".#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# xarray/tests/test_conventions.py::TestCFEncodedDataStore#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# needs the to_dataset. The other backends should be fine#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# without it.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m pytest.warns(#x1B[90m#x1B[39;49;00m
            #x1B[96mUserWarning#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            match=(#x1B[90m#x1B[39;49;00m
                #x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mVariable#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m(s#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m) referenced in bounds not in variables: #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m[#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33ml(at|ong)itude_bnds#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.#x1B[0m
#x1B[1m#x1B[31mE        Emitted warnings: [].#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1324: Failed

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_encoding_kwarg[3] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cfa620>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_encoding_kwarg#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        ds = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33my#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, np.arange(#x1B[94m10.0#x1B[39;49;00m))})#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        kwargs: #x1B[96mdict#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, Any] = #x1B[96mdict#x1B[39;49;00m(encoding={#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: {#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}})#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(ds, save_kwargs=kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1426: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_default_fill_value[3] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cfaa30>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_default_fill_value#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[90m# Test default encoding for float:#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ds = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33my#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, np.arange(#x1B[94m10.0#x1B[39;49;00m))})#x1B[90m#x1B[39;49;00m
        kwargs = #x1B[96mdict#x1B[39;49;00m(encoding={#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: {#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}})#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(ds, save_kwargs=kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1509: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_encoding_same_dtype[3] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f9bb5cfae90>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_encoding_same_dtype#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        ds = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33my#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, np.arange(#x1B[94m10.0#x1B[39;49;00m, dtype=#x1B[33m"#x1B[39;49;00m#x1B[33mf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m))})#x1B[90m#x1B[39;49;00m
        kwargs = #x1B[96mdict#x1B[39;49;00m(encoding={#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: {#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}})#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(ds, save_kwargs=kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1558: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 12 runs failed: test_open_fsspec (xarray.tests.test_backends)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
#x1B[0m#x1B[37m@requires_zarr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[37m@requires_fsspec#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.filterwarnings(#x1B[33m"#x1B[39;49;00m#x1B[33mignore:deallocating CachingFileManager#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_open_fsspec#x1B[39;49;00m() -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mimport#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mfsspec#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                #x1B[96mhasattr#x1B[39;49;00m(zarr.storage, #x1B[33m"#x1B[39;49;00m#x1B[33mFSStore#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                #x1B[95mand#x1B[39;49;00m #x1B[96mhasattr#x1B[39;49;00m(zarr.storage.FSStore, #x1B[33m"#x1B[39;49;00m#x1B[33mgetitems#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            )  #x1B[90m# zarr v2#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[95mor#x1B[39;49;00m #x1B[96mhasattr#x1B[39;49;00m(zarr.storage, #x1B[33m"#x1B[39;49;00m#x1B[33mFsspecStore#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)  #x1B[90m# zarr v3#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33mzarr too old#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        ds = open_dataset(os.path.join(os.path.dirname(#x1B[91m__file__#x1B[39;49;00m), #x1B[33m"#x1B[39;49;00m#x1B[33mdata#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mexample_1.nc#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        m = fsspec.filesystem(#x1B[33m"#x1B[39;49;00m#x1B[33mmemory#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        mm = m.get_mapper(#x1B[33m"#x1B[39;49;00m#x1B[33mout1.zarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
>       ds.to_zarr(mm)  #x1B[90m# old interface#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:7156: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_mask_and_scale[3-dtype0-create_unsigned_masked_scaled_data-create_encoded_unsigned_masked_scaled_data] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e74730>
decoded_fn = <function create_unsigned_masked_scaled_data at 0x7f9bb77ad580>
encoded_fn = <function create_encoded_unsigned_masked_scaled_data at 0x7f9bb77ad620>
dtype = dtype('float64')

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        #x1B[33m"#x1B[39;49;00m#x1B[33mdecoded_fn, encoded_fn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                create_bad_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_bad_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mBad _Unsigned attribute.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (create_masked_and_scaled_data, create_encoded_masked_and_scaled_data),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat64#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_mask_and_scale#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, decoded_fn, encoded_fn, dtype) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mhasattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr_version#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[95mand#x1B[39;49;00m dtype == np.float32:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32 will be treated as float64 in zarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        decoded = decoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        encoded = encoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m decoded[#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].encoding[#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] == #x1B[33m"#x1B[39;49;00m#x1B[33mu1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            (#x1B[96mself#x1B[39;49;00m.engine == #x1B[33m"#x1B[39;49;00m#x1B[33mnetcdf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[95mor#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format == #x1B[33m"#x1B[39;49;00m#x1B[33mNETCDF4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33muint8 data can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be written to non-NetCDF4 data#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int8(-1)
dtype = dtype('int8')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_mask_and_scale[3-dtype0-create_signed_masked_scaled_data-create_encoded_signed_masked_scaled_data] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e747d0>
decoded_fn = <function create_signed_masked_scaled_data at 0x7f9bb77ad800>
encoded_fn = <function create_encoded_signed_masked_scaled_data at 0x7f9bb77ad8a0>
dtype = dtype('float64')

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        #x1B[33m"#x1B[39;49;00m#x1B[33mdecoded_fn, encoded_fn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                create_bad_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_bad_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mBad _Unsigned attribute.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (create_masked_and_scaled_data, create_encoded_masked_and_scaled_data),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat64#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_mask_and_scale#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, decoded_fn, encoded_fn, dtype) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mhasattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr_version#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[95mand#x1B[39;49;00m dtype == np.float32:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32 will be treated as float64 in zarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        decoded = decoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        encoded = encoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m decoded[#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].encoding[#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] == #x1B[33m"#x1B[39;49;00m#x1B[33mu1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            (#x1B[96mself#x1B[39;49;00m.engine == #x1B[33m"#x1B[39;49;00m#x1B[33mnetcdf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[95mor#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format == #x1B[33m"#x1B[39;49;00m#x1B[33mNETCDF4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33muint8 data can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be written to non-NetCDF4 data#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int8(-127)
dtype = dtype('int8')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_mask_and_scale[3-dtype0-create_masked_and_scaled_data-create_encoded_masked_and_scaled_data] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e74870>
decoded_fn = <function create_masked_and_scaled_data at 0x7f9bb77ad440>
encoded_fn = <function create_encoded_masked_and_scaled_data at 0x7f9bb77ad4e0>
dtype = dtype('float64')

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        #x1B[33m"#x1B[39;49;00m#x1B[33mdecoded_fn, encoded_fn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                create_bad_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_bad_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mBad _Unsigned attribute.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (create_masked_and_scaled_data, create_encoded_masked_and_scaled_data),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat64#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_mask_and_scale#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, decoded_fn, encoded_fn, dtype) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mhasattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr_version#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[95mand#x1B[39;49;00m dtype == np.float32:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32 will be treated as float64 in zarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        decoded = decoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        encoded = encoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m decoded[#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].encoding[#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] == #x1B[33m"#x1B[39;49;00m#x1B[33mu1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            (#x1B[96mself#x1B[39;49;00m.engine == #x1B[33m"#x1B[39;49;00m#x1B[33mnetcdf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[95mor#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format == #x1B[33m"#x1B[39;49;00m#x1B[33mNETCDF4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33muint8 data can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be written to non-NetCDF4 data#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int16(-1)
dtype = dtype('int16')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_unsigned[3-fill_value0-False] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e74c30>
fill_value = np.int8(-1), exp_fill_warning = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mfill_value#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mexp_fill_warning#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (np.int8(-#x1B[94m1#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (np.uint8(#x1B[94m255#x1B[39;49;00m), #x1B[94mTrue#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (-#x1B[94m1#x1B[39;49;00m, #x1B[94mFalse#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (#x1B[94m255#x1B[39;49;00m, #x1B[94mTrue#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_unsigned#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, fill_value, exp_fill_warning):#x1B[90m#x1B[39;49;00m
        #x1B[37m@contextlib#x1B[39;49;00m.contextmanager#x1B[90m#x1B[39;49;00m
        #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_roundtrip_with_warnings#x1B[39;49;00m(*args, **kwargs):#x1B[90m#x1B[39;49;00m
            is_np2 = module_available(#x1B[33m"#x1B[39;49;00m#x1B[33mnumpy#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, minversion=#x1B[33m"#x1B[39;49;00m#x1B[33m2.0.0.dev0#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m exp_fill_warning #x1B[95mand#x1B[39;49;00m is_np2:#x1B[90m#x1B[39;49;00m
                warn_checker: contextlib.AbstractContextManager = pytest.warns(#x1B[90m#x1B[39;49;00m
                    SerializationWarning,#x1B[90m#x1B[39;49;00m
                    match=#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue attribute can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be represented#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                warn_checker = contextlib.nullcontext()#x1B[90m#x1B[39;49;00m
            #x1B[94mwith#x1B[39;49;00m warn_checker:#x1B[90m#x1B[39;49;00m
                #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(*args, **kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
                    #x1B[94myield#x1B[39;49;00m actual#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# regression/numpy2 test for#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        encoding = {#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: fill_value,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_Unsigned#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mtrue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mi1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
        x = np.array([#x1B[94m0#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m, #x1B[94m127#x1B[39;49;00m, #x1B[94m128#x1B[39;49;00m, #x1B[94m254#x1B[39;49;00m, np.nan], dtype=np.float32)#x1B[90m#x1B[39;49;00m
        decoded = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33mt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, x, {}, encoding)})#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        attributes = {#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: fill_value,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_Unsigned#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mtrue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
        #x1B[90m# Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        sb = np.asarray([#x1B[94m0#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m, #x1B[94m127#x1B[39;49;00m, -#x1B[94m128#x1B[39;49;00m, -#x1B[94m2#x1B[39;49;00m, -#x1B[94m1#x1B[39;49;00m], dtype=#x1B[33m"#x1B[39;49;00m#x1B[33mi1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        encoded = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33mt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, sb, attributes)})#x1B[90m#x1B[39;49;00m
        unsigned_dtype = np.dtype(#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mu#x1B[39;49;00m#x1B[33m{#x1B[39;49;00msb.dtype.itemsize#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m _roundtrip_with_warnings(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1215: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1194: in _roundtrip_with_warnings
    #x1B[0m#x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(*args, **kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int8(-1)
dtype = dtype('int8')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_unsigned[3--1-False] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e74d20>
fill_value = -1, exp_fill_warning = False

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        (#x1B[33m"#x1B[39;49;00m#x1B[33mfill_value#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mexp_fill_warning#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (np.int8(-#x1B[94m1#x1B[39;49;00m), #x1B[94mFalse#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (np.uint8(#x1B[94m255#x1B[39;49;00m), #x1B[94mTrue#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (-#x1B[94m1#x1B[39;49;00m, #x1B[94mFalse#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (#x1B[94m255#x1B[39;49;00m, #x1B[94mTrue#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_unsigned#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, fill_value, exp_fill_warning):#x1B[90m#x1B[39;49;00m
        #x1B[37m@contextlib#x1B[39;49;00m.contextmanager#x1B[90m#x1B[39;49;00m
        #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_roundtrip_with_warnings#x1B[39;49;00m(*args, **kwargs):#x1B[90m#x1B[39;49;00m
            is_np2 = module_available(#x1B[33m"#x1B[39;49;00m#x1B[33mnumpy#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, minversion=#x1B[33m"#x1B[39;49;00m#x1B[33m2.0.0.dev0#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m exp_fill_warning #x1B[95mand#x1B[39;49;00m is_np2:#x1B[90m#x1B[39;49;00m
                warn_checker: contextlib.AbstractContextManager = pytest.warns(#x1B[90m#x1B[39;49;00m
                    SerializationWarning,#x1B[90m#x1B[39;49;00m
                    match=#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue attribute can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be represented#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                warn_checker = contextlib.nullcontext()#x1B[90m#x1B[39;49;00m
            #x1B[94mwith#x1B[39;49;00m warn_checker:#x1B[90m#x1B[39;49;00m
                #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(*args, **kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
                    #x1B[94myield#x1B[39;49;00m actual#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# regression/numpy2 test for#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        encoding = {#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: fill_value,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_Unsigned#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mtrue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mi1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
        x = np.array([#x1B[94m0#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m, #x1B[94m127#x1B[39;49;00m, #x1B[94m128#x1B[39;49;00m, #x1B[94m254#x1B[39;49;00m, np.nan], dtype=np.float32)#x1B[90m#x1B[39;49;00m
        decoded = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33mt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, x, {}, encoding)})#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        attributes = {#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: fill_value,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m_Unsigned#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mtrue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
        #x1B[90m# Create unsigned data corresponding to [0, 1, 127, 128, 255] unsigned#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        sb = np.asarray([#x1B[94m0#x1B[39;49;00m, #x1B[94m1#x1B[39;49;00m, #x1B[94m127#x1B[39;49;00m, -#x1B[94m128#x1B[39;49;00m, -#x1B[94m2#x1B[39;49;00m, -#x1B[94m1#x1B[39;49;00m], dtype=#x1B[33m"#x1B[39;49;00m#x1B[33mi1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        encoded = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33mt#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, sb, attributes)})#x1B[90m#x1B[39;49;00m
        unsigned_dtype = np.dtype(#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mu#x1B[39;49;00m#x1B[33m{#x1B[39;49;00msb.dtype.itemsize#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m _roundtrip_with_warnings(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1215: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1194: in _roundtrip_with_warnings
    #x1B[0m#x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(*args, **kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int8(-1)
dtype = dtype('int8')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_grid_mapping_and_bounds_are_not_coordinates_in_file[3] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e74e10>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_grid_mapping_and_bounds_are_not_coordinates_in_file#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        original = #x1B[96mself#x1B[39;49;00m._create_cf_dataset()#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(original, open_kwargs={#x1B[33m"#x1B[39;49;00m#x1B[33mdecode_coords#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[94mFalse#x1B[39;49;00m}) #x1B[94mas#x1B[39;49;00m ds:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1291: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_coordinate_variables_after_dataset_roundtrip[3] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e74f00>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_coordinate_variables_after_dataset_roundtrip#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        original = #x1B[96mself#x1B[39;49;00m._create_cf_dataset()#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(original, open_kwargs={#x1B[33m"#x1B[39;49;00m#x1B[33mdecode_coords#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mall#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1299: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip[3] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
 Emitted warnings: [].
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e74ff0>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        original = #x1B[96mself#x1B[39;49;00m._create_cf_dataset()#x1B[90m#x1B[39;49;00m
        #x1B[90m# The DataArray roundtrip should have the same warnings as the#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# Dataset, but we already tested for those, so just go for the#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# new warnings.  It would appear that there is no way to tell#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# pytest "This warning and also this warning should both be#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# present".#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# xarray/tests/test_conventions.py::TestCFEncodedDataStore#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# needs the to_dataset. The other backends should be fine#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# without it.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mwith#x1B[39;49;00m pytest.warns(#x1B[90m#x1B[39;49;00m
            #x1B[96mUserWarning#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            match=(#x1B[90m#x1B[39;49;00m
                #x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mVariable#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m(s#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m) referenced in bounds not in variables: #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m[#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33ml(at|ong)itude_bnds#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
>           #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(#x1B[90m#x1B[39;49;00m
                original[#x1B[33m"#x1B[39;49;00m#x1B[33mvariable#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].to_dataset(), open_kwargs={#x1B[33m"#x1B[39;49;00m#x1B[33mdecode_coords#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mall#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}#x1B[90m#x1B[39;49;00m
            ) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1331: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

#x1B[33mDuring handling of the above exception, another exception occurred:#x1B[0m

self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e74ff0>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_grid_mapping_and_bounds_are_coordinates_after_dataarray_roundtrip#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        original = #x1B[96mself#x1B[39;49;00m._create_cf_dataset()#x1B[90m#x1B[39;49;00m
        #x1B[90m# The DataArray roundtrip should have the same warnings as the#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# Dataset, but we already tested for those, so just go for the#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# new warnings.  It would appear that there is no way to tell#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# pytest "This warning and also this warning should both be#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# present".#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# xarray/tests/test_conventions.py::TestCFEncodedDataStore#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# needs the to_dataset. The other backends should be fine#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# without it.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m pytest.warns(#x1B[90m#x1B[39;49;00m
            #x1B[96mUserWarning#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            match=(#x1B[90m#x1B[39;49;00m
                #x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mVariable#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m(s#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m) referenced in bounds not in variables: #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m[#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33ml(at|ong)itude_bnds#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m\#x1B[39;49;00m#x1B[33m]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.#x1B[0m
#x1B[1m#x1B[31mE        Emitted warnings: [].#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1324: Failed

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_encoding_kwarg[3] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e75680>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_encoding_kwarg#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        ds = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33my#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, np.arange(#x1B[94m10.0#x1B[39;49;00m))})#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        kwargs: #x1B[96mdict#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, Any] = #x1B[96mdict#x1B[39;49;00m(encoding={#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: {#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}})#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(ds, save_kwargs=kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1426: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_default_fill_value[3] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e75bd0>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_default_fill_value#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[90m# Test default encoding for float:#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ds = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33my#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, np.arange(#x1B[94m10.0#x1B[39;49;00m))})#x1B[90m#x1B[39;49;00m
        kwargs = #x1B[96mdict#x1B[39;49;00m(encoding={#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: {#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}})#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(ds, save_kwargs=kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1509: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_encoding_same_dtype[3] (xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Windows pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrNoConsolidatedMetadataSupport object at 0x7f9bb5e761c0>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_encoding_same_dtype#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        ds = Dataset({#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: (#x1B[33m"#x1B[39;49;00m#x1B[33my#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, np.arange(#x1B[94m10.0#x1B[39;49;00m, dtype=#x1B[33m"#x1B[39;49;00m#x1B[33mf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m))})#x1B[90m#x1B[39;49;00m
        kwargs = #x1B[96mdict#x1B[39;49;00m(encoding={#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: {#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[33m"#x1B[39;49;00m#x1B[33mf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m}})#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(ds, save_kwargs=kwargs) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1558: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.float32(nan)
dtype = dtype('float32')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mint#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:140: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDirectoryStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

7 out of 9 runs failed: test_roundtrip_mask_and_scale[3-dtype0-create_unsigned_masked_scaled_data-create_encoded_unsigned_masked_scaled_data] (xarray.tests.test_backends.TestZarrDirectoryStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDirectoryStore object at 0x7f9bb5defe30>
decoded_fn = <function create_unsigned_masked_scaled_data at 0x7f9bb77ad580>
encoded_fn = <function create_encoded_unsigned_masked_scaled_data at 0x7f9bb77ad620>
dtype = dtype('float64')

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        #x1B[33m"#x1B[39;49;00m#x1B[33mdecoded_fn, encoded_fn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                create_bad_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_bad_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mBad _Unsigned attribute.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (create_masked_and_scaled_data, create_encoded_masked_and_scaled_data),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat64#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_mask_and_scale#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, decoded_fn, encoded_fn, dtype) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mhasattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr_version#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[95mand#x1B[39;49;00m dtype == np.float32:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32 will be treated as float64 in zarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        decoded = decoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        encoded = encoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m decoded[#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].encoding[#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] == #x1B[33m"#x1B[39;49;00m#x1B[33mu1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            (#x1B[96mself#x1B[39;49;00m.engine == #x1B[33m"#x1B[39;49;00m#x1B[33mnetcdf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[95mor#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format == #x1B[33m"#x1B[39;49;00m#x1B[33mNETCDF4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33muint8 data can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be written to non-NetCDF4 data#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int8(-1)
dtype = dtype('int8')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDirectoryStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

7 out of 9 runs failed: test_roundtrip_mask_and_scale[3-dtype0-create_signed_masked_scaled_data-create_encoded_signed_masked_scaled_data] (xarray.tests.test_backends.TestZarrDirectoryStore)

artifacts/Test results for OS Linux pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-dask pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-no-numba pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS Linux pixi-env test-py313-with-typing pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py311 pytest-addopts/pytest.xml [took 0s]
artifacts/Test results for OS macOS pixi-env test-py313 pytest-addopts/pytest.xml [took 0s]
Raw output
AssertionError
self = <xarray.tests.test_backends.TestZarrDirectoryStore object at 0x7f9bb5defed0>
decoded_fn = <function create_signed_masked_scaled_data at 0x7f9bb77ad800>
encoded_fn = <function create_encoded_signed_masked_scaled_data at 0x7f9bb77ad8a0>
dtype = dtype('float64')

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        #x1B[33m"#x1B[39;49;00m#x1B[33mdecoded_fn, encoded_fn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                create_bad_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_bad_encoded_unsigned_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                marks=pytest.mark.xfail(reason=#x1B[33m"#x1B[39;49;00m#x1B[33mBad _Unsigned attribute.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_signed_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (#x1B[90m#x1B[39;49;00m
                create_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
                create_encoded_unsigned_false_masked_scaled_data,#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            (create_masked_and_scaled_data, create_encoded_masked_and_scaled_data),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat64#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m), np.dtype(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)])#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_roundtrip_mask_and_scale#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, decoded_fn, encoded_fn, dtype) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mhasattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr_version#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[95mand#x1B[39;49;00m dtype == np.float32:#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33mfloat32 will be treated as float64 in zarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        decoded = decoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        encoded = encoded_fn(dtype)#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m decoded[#x1B[33m"#x1B[39;49;00m#x1B[33mx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].encoding[#x1B[33m"#x1B[39;49;00m#x1B[33mdtype#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] == #x1B[33m"#x1B[39;49;00m#x1B[33mu1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            (#x1B[96mself#x1B[39;49;00m.engine == #x1B[33m"#x1B[39;49;00m#x1B[33mnetcdf4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[95mor#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.file_format == #x1B[33m"#x1B[39;49;00m#x1B[33mNETCDF4#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            pytest.skip(#x1B[33m"#x1B[39;49;00m#x1B[33muint8 data can#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mt be written to non-NetCDF4 data#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.roundtrip(decoded) #x1B[94mas#x1B[39;49;00m actual:#x1B[90m#x1B[39;49;00m
             ^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:1132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/.pixi/envs/test-py313-no-numba/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mnext#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.gen)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2649: in roundtrip
    #x1B[0m#x1B[96mself#x1B[39;49;00m.save(data, store_target, **save_kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:2631: in save
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m dataset.to_zarr(store=store_target, **kwargs, **#x1B[96mself#x1B[39;49;00m.version_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:2390: in to_zarr
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m to_zarr(  #x1B[90m# type: ignore[call-overload,misc]#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:797: in to_zarr
    #x1B[0mdump_to_store(dataset, zstore, writer, encoding=encoding)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/writers.py#x1B[0m:491: in dump_to_store
    #x1B[0mstore.store(variables, attrs, check_encoding, writer, unlimited_dims=unlimited_dims)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1090: in store
    #x1B[0m#x1B[96mself#x1B[39;49;00m.set_variables(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:1224: in set_variables
    #x1B[0mattrs[#x1B[33m"#x1B[39;49;00m#x1B[33m_FillValue#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = FillValueCoder.encode(fv, dtype)#x1B[90m#x1B[39;49;00m
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'xarray.backends.zarr.FillValueCoder'>, value = np.int8(-127)
dtype = dtype('int8')

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mencode#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m, value: #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m | #x1B[96mcomplex#x1B[39;49;00m | #x1B[96mstr#x1B[39;49;00m | #x1B[96mbytes#x1B[39;49;00m, dtype: np.dtype[Any]#x1B[90m#x1B[39;49;00m
    ) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mS#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# byte string, this implies that 'value' must also be `bytes` dtype.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mbytes#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m base64.standard_b64encode(value).decode()#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# boolean#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mbool#x1B[39;49;00m(value)#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m dtype.kind #x1B[95min#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33miu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# todo: do we want to check for decimals?#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(value, #x1B[96mint#x1B[39;49;00m | #x1B[96mfloat#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/backends/zarr.py#x1B[0m:137: AssertionError