From d5b12b6dbd6599840aeea773f546a66627dbc874 Mon Sep 17 00:00:00 2001 From: TomNicholas Date: Mon, 1 Jul 2024 12:46:05 -0400 Subject: [PATCH] new test to show how #18 doesn't fully work yet --- virtualizarr/tests/test_xarray.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/virtualizarr/tests/test_xarray.py b/virtualizarr/tests/test_xarray.py index 34e51c7b..220cc1d0 100644 --- a/virtualizarr/tests/test_xarray.py +++ b/virtualizarr/tests/test_xarray.py @@ -289,7 +289,23 @@ def test_combine_by_coords(self, netcdf4_files): ) assert combined_vds.xindexes["time"].to_pandas_index().is_monotonic_increasing + + @pytest.mark.xfail(reason="Not yet implemented, see issue #18") + def test_combine_by_coords_keeping_manifestarrays(self, netcdf4_files): + filepath1, filepath2 = netcdf4_files + + with pytest.warns(UserWarning, match="will create in-memory pandas indexes"): + vds1 = open_virtual_dataset(filepath1) + with pytest.warns(UserWarning, match="will create in-memory pandas indexes"): + vds2 = open_virtual_dataset(filepath2) + + combined_vds = xr.combine_by_coords( + [vds2, vds1], + ) + assert isinstance(combined_vds["time"].data, ManifestArray) + assert isinstance(combined_vds["lat"].data, ManifestArray) + assert isinstance(combined_vds["lon"].data, ManifestArray) @network @requires_s3fs