filesystem.get mixes up filenames (when using GitHub)
See original GitHub issueDisclaimer: I might be going about this the wrong way. If I do, please enlighten me 😄
I have the following snippet which (I hoped) would copy 3 files from a remote into a local folder:
fs = fsspec.filesystem("github", org="githubtraining", repo="hellogitworld")
fs.get(
["README.txt", "/resources/labels.properties", "/src/test/java/com/github/AppTest.java"],
["README.txt", "labels.properties", "AppTest.java")],
)
It does copy the content of the three files; however the order is mixed up. I.e., the copying happens as follows (order: remote --> local):
- “README.txt” --> “AppTest.java”
- “/resources/labels.properties” --> “README.txt”
- “/src/test/java/com/github/AppTest.java” --> “labels.properties”
I haven’t dug into the source of fsspec, but my hunch is that it has to do with GH having a different order of files remotely than what is listed in the query.
Is this intended behavior? If so, what is the rationale behind it?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
duplicate files being overwritten · Issue #305 - GitHub
I have tried several way and this is the only way that prevent all issues with file name. Using timestamp is unique, so...
Read more >Filenames and directories truncated to 30 characters #2706
Just make a simple project with an embedded resource file name with more than 30 characters, example: mylongfilenameherebuthereandherealso.
Read more >FileMigrationHelper: Issue with case sensitive folder paths #273
Place an image in a folder with an uppercase name (e.g. assets/Planning/diagram. · Create a corresponding entry in the File table with a...
Read more >Enable filenames with colon (:) on drvfs · Issue #1514 - GitHub
A plain dir shows the first line (size 0, short filename up to the colon), dir /r reveals the complete name with a...
Read more >File names missing when using local files #1881 - GitHub
Describe the bug Label studio don't infer filenames from file system while using local files option To Reproduce Steps to reproduce the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No rush, I haven’t had any other complaints about this. I assume most people access single specific files with the github backend (so no problem with ordering) or, if they want many files, just clone the repo.
Thanks for the test case! I will look at this early next week if no one gets to it, and put out a release when fixed.