Cannot pickle '_io.BufferedReader' object exception after DataArray transpose and copy operations when using fsspec filecache.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
What is your issue?
We hit this issue while using rioxarray with a series of operations similar to those noted in this issue https://github.com/corteva/rioxarray/issues/711. After looking through the rioxarray codebase a bit I was able to reproduce the issue with pure xarray operations.
When opening a Dataset with fsspec local caching enabled, transposing a DataArray's coordinates and then copying the DataArray results in a cannot pickle '_io.BufferedReader' object exception.
The issue can be reproduced using this sample notebook.
Note that when using the filecache option with fsspec.filesystem the exception occurs immediately. When using the blockcache option the exception only occurs after a second copy call which is presumably using cached data.
This issue seems potentially related to the fsspec investigation in https://github.com/fsspec/filesystem_spec/issues/579#issuecomment-1140377495 but interestingly only seems reproducible with this incantation of transpose followed by copy.
Contributor 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.
Research direction
Start with the linked sample notebook and reproduce the transpose-then-copy sequence using fsspec filecache, then compare it with blockcache behavior. The issue names no repository files or tests; done means the reproduced DataArray operations no longer raise the BufferedReader pickle exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100