diff --git a/fsspec/implementations/tests/test_reference.py b/fsspec/implementations/tests/test_reference.py index 762d83137..d980cd139 100644 --- a/fsspec/implementations/tests/test_reference.py +++ b/fsspec/implementations/tests/test_reference.py @@ -759,3 +759,27 @@ def test_append_parquet(lazy_refs, m): with pytest.raises(KeyError): lazy2["data/0"] assert lazy2["data/1"] == b"Adata" + + +def test_deep_parq(m): + zarr = pytest.importorskip("zarr") + lz = fsspec.implementations.reference.LazyReferenceMapper.create( + "memory://out.parq", fs=m + ) + g = zarr.open_group(lz, mode="w") + g2 = g.create_group("instant") + g2.create_dataset(name="one", data=[1, 2, 3]) + lz.flush() + + lz = fsspec.implementations.reference.LazyReferenceMapper("memory://out.parq", fs=m) + g = zarr.open_group(lz) + assert g.instant.one[:].tolist() == [1, 2, 3] + assert sorted(_["name"] for _ in lz.ls("")) == [".zgroup", ".zmetadata", "instant"] + assert sorted(_["name"] for _ in lz.ls("instant")) == [ + "instant/.zgroup", + "instant/one", + ] + assert sorted(_["name"] for _ in lz.ls("instant/one")) == [ + "instant/one/.zarray", + "instant/one/0", + ]