Repository navigation
Pass target_options when MultiZarrToZarr reads reference files from paths - #591
Open
bhaskargurram-ai wants to merge 1 commit into
Open
bhaskargurram-ai wants to merge 1 commit into
bhaskargurram-ai wants to merge 1 commit into
Conversation
…aths When the inputs are paths to JSON reference files, the batch read used a filesystem created with asynchronous=True and called its blocking cat(), which fails with "Loop is not running" for http/s3/gcs paths. It also ignored the compression given in target_options, and decoded the files in the sorted order returned by cat() rather than the order of the inputs, so INDEX, list and filename-based coo_map selectors could be paired with the wrong dataset. Read the files through the filesystem of the OpenFiles, decompress with the compression of each OpenFile, keep the input order, and pass target_options to ReferenceFileSystem when falling back to opening each path. Fixes fsspec#522
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.
When MultiZarrToZarr is given paths to JSON reference files, the batch read ignored target_options, so gzip-compressed references failed to decode (#522). The same code built the filesystem with asynchronous=True and then called its blocking cat(), which raises "Loop is not running" for http, s3 and gcs paths. It also decoded the files in the sorted order cat() returns rather than the input order, so INDEX, list and filename coo_map selectors could be matched to the wrong dataset.
I now read the files through the filesystem of the OpenFiles, decompress each with its own compression, keep the input order, and pass target_options to ReferenceFileSystem in the per-file fallback.
New tests in test_combine.py cover gzip references, input order, and paths served from a local HTTP server. They fail on main and pass with this change.
Fixes #522