Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy_all() does not copy group attributes #613

Closed
nernelly opened this issue Sep 22, 2020 · 1 comment · Fixed by #659
Closed

copy_all() does not copy group attributes #613

nernelly opened this issue Sep 22, 2020 · 1 comment · Fixed by #659
Labels
bug Potential issues with the zarr-python library
Milestone

Comments

@nernelly
Copy link

nernelly commented Sep 22, 2020

Minimal example

import zarr

# setup group in memory store  
store_mem = zarr.MemoryStore()
group_mem = zarr.group(store = store_mem, overwrite=True)
group_mem.attrs['info'] = 'group attrs'

# setup group in directory store
data_path = 'tmp/example.zarr'
store_dir = zarr.DirectoryStore(data_path)
group_dir  = zarr.group(store = store_dir, overwrite=True)

# copy from memory to directory store 
zarr.copy_all(group_mem, group_dir, if_exists='replace', dry_run=False)

print(group_mem.attrs['info'])     # works
print(group_dir.attrs['info'])         # fails with KeyError: 'info'

Problem description

Looks like zarr.copy_all() does not copy attributes of a group between zarr-groups. Copying of array and attributes seems to be working well.

Version and installation information

  • Value of zarr.__version__== 2.4.0
  • Value of numcodecs.__version__==0.7.2
  • Version of Python interpreter: 3.6.9
  • Operating system: Linux
  • Installed using pip into virtual environment; running in jupyter
@rabernat rabernat added the bug Potential issues with the zarr-python library label Nov 19, 2020
@rabernat
Copy link
Contributor

Thanks for the bug report @nernelly! I agree that this is a problem.

@Carreau Carreau mentioned this issue Nov 23, 2020
Carreau added a commit to Carreau/zarr-python that referenced this issue Nov 30, 2020
Closes zarr-developers#613

This only affect the root as _copy does the right thing on recursion.
Carreau added a commit to Carreau/zarr-python that referenced this issue Nov 30, 2020
Closes zarr-developers#613

This only affect the root as _copy does the right thing on recursion.
@Carreau Carreau added this to the v2.6 milestone Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Potential issues with the zarr-python library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants