-
Notifications
You must be signed in to change notification settings - Fork 382
Add support for rm_file in GitHubFileSystem implementation #1839
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
Conversation
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.
Looking generally good.
Thanks for the review, @martindurant. By the way, based on merge workflow, it seems that initializing the filesystem with incorrect credentials (mock data) behaves differently in
|
You mean as opposed to NotFound? The test can be version-specific if need be. |
This is the line where the test fails due to a 403 error:
The error occurs when attempting to retrieve the SHA inside At first, I suspected the issue was related to the Python version, since the failure only appeared under Python 3.10 test workflow. However, after running the same test locally using Miniconda with Python 3.10, it passed without issues. I now believe the failure is due to GitHub rejecting unauthenticated or invalid-token access to certain endpoints. This can happen if the API rate limit for unauthenticated requests has been exceeded. |
I suppose it's fine. We can add more docs around it if people start noticing this. Particularly around the new delete (and write) functionality, we don't expect anyone to come with an invalid token! |
This PR adds support for the
rm_file
method in theGitHubFileSystem
implementation of fsspec, enabling file deletion using the GitHub REST API.The GitHub API for managing file contents requires:
This implementation adheres to those requirements, making rm_file work reliably for GitHub-backed filesystems.
Note: This PR focuses solely on file deletion. I plan to follow up with a separate PR to implement the remaining methods and functionality (e.g., adding file, updating file, etc.) for full
GitHubFileSystem
support.Fixes #1836