-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support for pickling #125
Comments
No, pickling isn't currently supported. It looks like in general pickling is possible to implement via the However It is possible to take a builder and access its string-compatible key-value config. However not all confg parameters can be represented as strings. E.g. the So I'd like to say that pickling is out of scope for this library. I don't see any easy way to implement pickling aside from re-implementing all the configuration that object-store already has internally. |
I think the most likely approach to support pickling would be to have a separate class like I'm not sure if that half-baked solution would be good enough or more trouble than it's worth |
Thanks for the detailed explanation @kylebarron! Ill have to digest this for a bit and am wondering what would be feasible directions for pangeo-forge given this constraint... Generally I would think this can be closed as an issue if you agree? |
We can leave it open; a few people have asked about it already. |
Some form of pickling will also be required for obstore-backed Zarr storage (as noted in the description of the failing tests zarr-developers/zarr-python#1661 (comment)). Joe Hamman mentioned having a vision for a MVP for serializing Zarr.Storage.ObjectStore at the Pangeo hackday. @jhamman, do you mind sharing if you have any insight into whether pickling could be implemented in zarr-developers/zarr-python#1661 rather than obstore itself? I think that would at least allow NetCDF -> VirtualiZarr -> Obstore + Zarr -> Dask/Beam even if NetCDF -> Obstore + h5netcdf -> Dask/Beam isn't practical. |
It shouldn't be a problem to do this in Zarr. we just need to package up the config needed to recreate the ObjectStore class in |
Hi there,
@jbusecke and I were playing around with using obstore to read netcdf files into Xarray as part of apache-beam data ingestion pipeline. This requires the serialization of objects that are passed between stages. We ran into an error when beam was trying to pickle a dataset. We reproduced the behavior without beam.
Anyhow, wondering if it's possible to pickle obstore-backed Xarray datasets or if this is a limitation that we don't understand.
Create the example dataset
This works with fsspec
This fails with obstore's fsspec wrapper
TypeError: cannot pickle 'builtins.LocalStore' object
traceback:
We get the same error when trying to pickle the
LocalStore(prefix=Path("."))
object.Thanks!
cc @sharkinsspatial
The text was updated successfully, but these errors were encountered: