Repository navigation
Create parent directories before FSMap batch writes - #2287
Merged
martindurant merged 3 commits intoOct 26, 2026
Merged
Conversation
AryanRG
force-pushed
the
fix/fsmap-setitems-parent-retry
branch
from
October 14, 2026 15:51
290077f to
61bd21c
Compare
AryanRG
marked this pull request as ready for review
October 14, 2026 15:52
Contributor
Author
|
Resolved the merge conflict and kept both sets of mapping tests. The updated branch passes the available local suite. |
Comment on lines
+138
to
+139
| # Missing parent directories: create them, as __setitem__ does, | ||
| # then retry the bulk write once. Successful writes skip this. |
Member
There was a problem hiding this comment.
Actually, it unconditionally calls mkdirs first - so we can do that.
Contributor
Author
There was a problem hiding this comment.
You’re right, that matches __setitem__. I’ll update it to create the parent directories before the batch write.
Contributor
Author
There was a problem hiding this comment.
Updated to create the parent directories before the batch write, matching __setitem__. Added transaction and error-handling tests too. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
FSMap.setitems({"foo/bar": b"baz"})fails on a local filesystem withauto_mkdir=False, while assigning the same key through__setitem__works.Create each distinct parent directory before the bulk write, matching
__setitem__. This also lets deferred local transaction writes commit when their parent directories don't exist. The batch is written once, without retrying errors. Key/value conversion is unchanged, and an empty batch creates no directories.Fixes #1041.
Tested the mapping regressions and the available full suite on macOS with Python 3.12. Ruff and the configured pre-commit hooks pass. Optional backend/service tests were skipped where dependencies were unavailable; the full cloud and platform matrix was not run locally.
Prepared with AI assistance.