Invalid --chunks/--shards arguments to b2nd-to-zarr deletes destination with --force
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start by locating the b2nd-to-zarr command implementation and tracing where it removes the destination with --force relative to its call to zarr.create_array. Reproduce the failure using the shell commands in the issue, including --chunks 30 --shards 50 --force. Done means invalid arguments no longer cause the existing destination to disappear when conversion fails.
Written by the indexing model from the issue text.
Description
Describe the bug
If a user creates a .zarr file using b2nd-to-zarr, then subsequently calls b2nd-to-zarr again with arguments to --chunks and --shards that are invalid, meaning shards % chunks != 0, then b2nd-to-zarr will call shutil.rmtree(dst_path) first and then call zarr.create_array which will fail. I think ideally the converter should throw an error before reaching zarr.create_array about invalid arguments to --chunks and --shards.
To Reproduce
Steps to reproduce the behavior:
Shell commands:
python -c "import blosc2, numpy as np; blosc2.asarray(np.arange(1000), urlpath='data.b2nd', mode='w')"
b2nd-to-zarr data.b2nd good.zarr -q && ls good.zarr
b2nd-to-zarr data.b2nd good.zarr --chunks 30 --shards 50 --force
Output:
Error: Chunk edge length 50 in dimension 0 is not divisible by the shard's inner chunk size 30.
Then
ls good.zarr
produces
ls: good.zarr: No such file or directory
Expected behavior
good.zarr should still exist even if the converter fails
Desktop:
- OS: Mac OS Tahoe
- Version 26.7
Additional context
I think one additional option besides throwing an earlier error message could be writing to a temporary path and then renaming it after success
- Dominant language
- Python
- Stars
- 211
- Forks
- 66
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 15
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Blosc/python-blosc2
-
documentation sustain-2026
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Blosc/python-blosc2#720 · 3 comments ·
Maintainers usually reply within 1 day
-
sustain-2026
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Blosc/python-blosc2#717 ·
Maintainers usually reply within 1 day
-
documentation sustain-2026
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Blosc/python-blosc2#714 ·
Maintainers usually reply within 1 day
-
documentation sustain-2026
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Blosc/python-blosc2#710 ·
Maintainers usually reply within 1 day
-
documentation sustain-2026
Difficulty 3/5 1-2 days Newbie friendliness 70/100
Blosc/python-blosc2#722 ·
Maintainers usually reply within 1 day
All issues in Blosc/python-blosc2
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 3 days
-
Negation with "not" and "no" is ignored during sentiment analysisPossibly taken @vivek-3728 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
techcsispit/mess-mood#11 · 1 comment ·
-
changelog investigate
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ramnes/notion-sdk-py#408 ·
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
btclib-org/btclib-wallet#267 ·
Maintainers usually reply within 1 day
-
good first issue tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
knnmelprop/YAADO#111 ·