Repository navigation
fix(group): make consolidate_metadata pick up changes in nested groups - #4684
Open
h-mayorquin wants to merge 2 commits into
Open
h-mayorquin wants to merge 2 commits into
h-mayorquin wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I work on the NWB ecosystem (Neurodata Without Borders), a data standard for neurophysiology and the software around it. NWB is built on HDMF, a package to specify data models and to read and write them in different storage backends. There are two backends, HDF5 and Zarr, and the Zarr one is
hdmf-zarrbuilt on zarr-python. One thing that we support is opening a file that already exists and adding to it, for example new rows in the table of electrodes. I found that when the file is in Zarr the write finishes without an error but the new rows are missing when the file is read back.The following is a reproduction in pure zarr of the same error.
tablestands for the table of electrodes, theappendfor the new rows and the attribute update for whathdmf-zarrdoes on every write:After the attribute update
consolidate_metadatadoes not pick up what happens insidetableanymore. An array that is resized there keeps its old shape in the consolidated metadata and one that is added is missing from it, however many times it is called. This only happens when the group is nested inside another group. Iftableis directly under the root the second line prints(4,).The cause is that
consolidate_metadatalists the members withuse_consolidated_for_children=Falsebut the option is not passed down when the listing goes into a child group. Sotableis listed from the consolidated metadata that it carries. It carries one as updating its attributes saves it with the consolidated metadata that it was opened with.This PR makes
consolidate_metadataread the groups from the store at every depth (it passes the option in the recursive call). I added a test for a group that is nested one level deeper than in the existing test as that one only covers direct children. The same line is part of #4343 by @d-v-b.For reviewers
What I want you to look at is whether it is OK to separate this from the original PR (#4343). That one is in draft and I am unsure about its scope and extent. So I am opening this one as this particular fix is important for us.
Author attestation
TODO
changes/