Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
PathLike wrapper/cache for ExternalStorage #186
base: main
Are you sure you want to change the base?
PathLike wrapper/cache for ExternalStorage #186
Changes from 4 commits
ffdb901
4ad7fb1
eb19e0f
8e6a78c
3be13c0
dda02e2
472151e
b692c2f
7432ff4
319d0d0
5650609
ddbbd19
c5ce48a
236b263
b805aac
ed5e83c
6181039
1880f73
1e4ca2c
a6d26f3
aabbc33
b4d73b3
7af006e
58a58bc
8e429f5
b70df48
08e3ac2
ca7871b
2aa0616
7c03dcd
383075e
6365398
d35bd60
7cc10f9
ab025f1
cd70ab2
ac1b1d0
ea054be
90f2597
a2e05b2
80eccc4
e9ed7a8
b4e1d42
2b070ca
4fd4a66
5e56461
73d3a1e
524cc6e
dd1b6dc
a575dd3
ba6fcff
5d0df5f
1418aee
e057332
1cfe910
78e003b
265e786
006d787
ce12326
9afeb2f
aaa2aab
cf60d1b
da9955e
8489c24
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
read_only
is mainly to prevent the following mistake:However, it won't stop
open(shared / "oldfile.txt", mode='wb')
. You can still overwrite that data. If that data is in a separate permanent storage, it will be fine -- only overwrite locally. (If you setshared
up such that the directory it uses is identical to the internal holding cache here, of course, it would overwrite that.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc
__del__
isn't called ondel obj
but instead when garbage collection happens. Maybe instead maketransfer_holding_to_external
always explicit and don't rely on garbage collection related thingsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me ... it's an executor-level thing anyway, and I don't mind asking the executor writer to think about how files get moved around (don't want to ask the protocol writer to think about that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or maybe if you want this behaviour, use a context manager, so instead of
__del__
use__exit__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This started out as a context manager. I switched it away because it makes actual usage kind of weird -- the entirety of the execution block where this is used gets indented by one level, which I don't particularly like. It gets worse if you have one of these for
shared
and one forpermanent
-- there's a syntax for setting multiple context managers at once, but I've also always found that kind of weird.But I can switch it back to a context manager if you want 🤷♂️