-
Notifications
You must be signed in to change notification settings - Fork 54
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
Expressive handler for fsspec block_size ValueError #142
Expressive handler for fsspec block_size ValueError #142
Conversation
Co-authored-by: Tom Augspurger <tom.augspurger88@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for getting this started @cisaacstern!
One comment below.
Big thanks to @martindurant for merging fsspec/filesystem_spec#646 🙏 I've now updated this PR to reflect the presence of the newly added upstream error. (Our checks are not passing because the latest release of A brief overview this PR's user experience follows. All outputs below reflect behavior with the unreleased
from smap_recipe import recipes # `smap_recipe` is the above-linked recipe module
rec = recipes['NASA-SMAP-SSS/JPL/8day'] # select an arbitrary recipe from the `dict_object`
rec.fsspec_open_kwargs = {} # clear its `fsspec_open_kwargs` to provoke the desired error
import fsspec
from pangeo_forge_recipes.storage import MetadataTarget, CacheFSSpecTarget
fs_gcs = fsspec.get_filesystem_class("memory")("gcs")
fs_osn = fsspec.get_filesystem_class("memory")("osn")
target_base = f's3://Pangeo/pangeo-forge'
cache_base = f'gs://pangeo-forge-us-central1/pangeo-forge-cache'
metadata_base = f'gs://pangeo-forge-us-central1/pangeo-forge-metadata'
endpoint_url = 'https://ncsa.osn.xsede.org'
feedstock_name = 'block_error_test'
fmt = 'zarr'
for recipe_key, r in recipes.items():
recipe_name = f'{feedstock_name}/{recipe_key}'
r.input_cache = CacheFSSpecTarget(fs_gcs, f"{cache_base}/{recipe_name}")
r.metadata_cache = MetadataTarget(fs_gcs, f"{metadata_base}/{recipe_name}")
r.target = MetadataTarget(fs_osn, f"{target_base}/{recipe_name}.{fmt}")
rec.cache_input((0,)) Traceback (TL;DR: the new errors work as expected!)
rec.fsspec_open_kwargs = {"block_size": 0}
rec.cache_input((0,))
IMHO, this is ready to merge following the next release of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @cisaacstern! Just a few suggestions.
We could also install fsspec from master in our CI environments to get the tests function. Or, as you suggest, wait for an fsspec release before merging. @martindurant - any idea when the next release might be?
Co-authored-by: Ryan Abernathey <ryan.abernathey@gmail.com>
Co-authored-by: Ryan Abernathey <ryan.abernathey@gmail.com>
Another good option. We can decide based on Martin's estimate of when the next release will be. And for the sake of completeness, here's the updated Traceback, following incorporation of @rabernat's suggestions to: a. wrap only a single line in the try/except block; b. raise a updated Traceback
|
@rabernat, fsspec has a new release, which I've pinned in the ci configs in the last commit here, and all checks now pass, so IMO this is ready to merge. |
Here's my attempt at a PR to address the suggestion raised in pangeo-forge/staged-recipes#31 (comment)
I am not certain if the existing tests will cover this case, or if an additional test is required. If the latter, I'll appreciate guidance from others on how to implement an appropriate test.