Skip to content
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

Require opt-in to pickling writable Sessions and Stores. #652

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dcherian
Copy link
Contributor

@dcherian dcherian commented Jan 31, 2025

This is uglier than it used to because we cannot deserialize to a read-only Session or Store by default anymore.
Well we could, but it would take some extra work.

I can add some docs once #633 goes in

Closes #478
xref #185 (comment)

@dcherian dcherian requested review from mpiannucci and paraseba and removed request for mpiannucci January 31, 2025 05:33
if allow_pickling:
with session.allow_pickling():
to_icechunk(data, store=session.store, mode="w")
with xr.open_zarr(session.store, consolidated=False) as ds:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not so nice now.

The distributed-read piece needs to be within the context manager now, because we can't (easily) set read-only status when unpickling. We could do so I think, by creating a brand new Session with branch=None. Let's discuss tomorrow..

This is uglier than it used to because we cannot deserialize to a
read-only Session or Store by default anymore.
Well we could, but it would take some extra work.

Closes #478
xref #185 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-enable Distributed Writes protections when pickling IcechunkStores in python
1 participant