Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Aug 20, 2024
1 parent f87072a commit 131605a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ impl ChangeSet {
// from new_arrays
let was_new = self.new_arrays.remove(&path).is_some();
self.updated_arrays.remove(&path);
self.updated_attributes.remove(&path);
self.set_chunks.remove(&path);
if !was_new {
self.deleted_arrays.insert(path, node_id);
Expand Down Expand Up @@ -937,6 +938,11 @@ mod tests {
let chunk = ds.get_chunk_ref(&array1_path, &ArrayIndices(vec![0, 0, 0])).await;
assert_eq!(chunk, Some(ChunkPayload::Inline("bac".into())));

let path: Path = "/group/array2".into();
assert!(ds.change_set.updated_attributes.contains_key(&path));
assert!(ds.delete_array(path.clone()).await.is_ok());
assert!(!ds.change_set.updated_attributes.contains_key(&path));

Ok(())
}

Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,8 @@ pub struct ChangeSet {
new_groups: HashMap<Path, NodeId>,
new_arrays: HashMap<Path, (NodeId, ZarrArrayMetadata)>,
updated_arrays: HashMap<Path, ZarrArrayMetadata>,
// These paths may point to Arrays or Groups,
// since both Groups and Arrays support UserAttributes
updated_attributes: HashMap<Path, Option<UserAttributes>>,
// FIXME: issue with too many inline chunks kept in mem
set_chunks: HashMap<Path, HashMap<ArrayIndices, Option<ChunkPayload>>>,
Expand Down

0 comments on commit 131605a

Please sign in to comment.