Skip to content

Cannot pickle '_io.BufferedReader' object exception after DataArray transpose and copy operations when using fsspec filecache. #8443

@sharkinsspatial

Description

@sharkinsspatial

What is your issue?

We hit this issue while using rioxarray with a series of operations similar to those noted in this issue corteva/rioxarray#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 fsspec/filesystem_spec#579 (comment) but interestingly only seems reproducible with this incantation of transpose followed by copy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions