Repository navigation
Fix mkdir without parents for simple relative paths - #3484
Open
student-shivamm wants to merge 1 commit into
Open
student-shivamm wants to merge 1 commit into
student-shivamm wants to merge 1 commit into
Conversation
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.
Description
Fix
LocalFileSystem.mkdir("relative", parents=False)incorrectly raisingMissingParentDirectorywhen the current working directory exists.For a path with no directory component,
os.path.dirname(path)returns an empty string. Useos.curdirfor that parent check. The behavior for nested paths remains covered by the tests.Motivation and Context
A simple relative path should work like
./relativewhen creating a directory without creating missing parents. The publicFileSystem.mkdircontract raisesMissingParentDirectorywhen the parent does not exist.Have you tested this? If so, how?
I have included unit tests. The parametrized test uses actual temporary directories for
relative,./relative, andparent/relative, and checks existing-directory and missing-parent exceptions.test/local_target_test.pycomparison: upstream 31 failed / 63 passed / 3 errors; candidate 30 failed / 64 passed / 3 errors. The only changed test outcome is the new regression passing. The same existing Windows failures and cleanup errors remain, including unavailable compression executables and file-handle deletion behavior.git diff --checkpasses.AI assistance was used for investigation, implementation and local validation.