Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/zarr/testing/stateful.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,8 @@ def delete_array_using_del(self, data: DataObject) -> None:
@precondition(lambda self: len(self.all_groups) >= 2) # fixme don't delete root
@rule(data=st.data())
def delete_group_using_del(self, data: DataObject) -> None:
group_path = data.draw(
st.sampled_from(sorted(self.all_groups)), label="Group deletion target"
)
members = tuple(filter(lambda v: "/" in v, sorted(self.all_groups)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. this will filter out foo/bar too no?
Suggested change
members = tuple(filter(lambda v: "/" in v, sorted(self.all_groups)))
members = tuple(filter(lambda v: v == "/", sorted(self.all_groups)))
  1. Should this op be an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will filter out foo/bar too no?

It will reject any member name that doesn't contain "/", so it will keep foo/bar

Copy link
Contributor

@dcherian dcherian Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about how this is working. Can you add a comment please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added in 724e3c9

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me know if this explanation needs more context, or if there's just a better way to get the same result -- I'm assuming it's a given that the name of the root group does not contain a "/" character.

group_path = data.draw(st.sampled_from(members), label="Group deletion target")
prefix, group_name = split_prefix_name(group_path)
note(f"Deleting group '{group_path=!r}', {prefix=!r}, {group_name=!r} using delete")
members = zarr.open_group(store=self.model, path=group_path).members(max_depth=None)
Expand Down
Loading