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

Set store to read only after unpickling #405

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Conversation

dcherian
Copy link
Contributor

Closes #383
xref #185

@dcherian dcherian requested a review from paraseba November 21, 2024 22:15
@@ -33,6 +34,7 @@

class IcechunkStore(Store, SyncMixin):
_store: PyIcechunkStore
_pickle_preserves_read_only: bool
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put this on this class, not PyIcechunkStore, since this is the one that handles pickling.

Copy link
Collaborator

@paraseba paraseba left a comment

Choose a reason for hiding this comment

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

It would be good to get a review from @mpiannucci too

self._pickle_preserves_read_only = True
yield
finally:
self._pickle_preserves_read_only = False
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't this be the previous value of the variable instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's always only modified in this method, so the previous value is always False.

@paraseba paraseba requested a review from mpiannucci November 21, 2024 23:54
Copy link
Contributor

@mpiannucci mpiannucci left a comment

Choose a reason for hiding this comment

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

Looks good to me

@dcherian dcherian merged commit ce83a62 into main Nov 22, 2024
2 checks passed
@dcherian dcherian deleted the read-only-after-pickle branch November 22, 2024 00:37
dcherian added a commit that referenced this pull request Nov 22, 2024
* main:
  Set store to read only after unpickling (#405)
  Update roadmap documentation (#398)
  Wire up Zarr property tests EAR-1189 (#68)
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.

Zero values after saving to a local store with dask localcluster.
3 participants